Skip to content

Instantly share code, notes, and snippets.

View bezysoftware's full-sized avatar

Tomas Bezouska bezysoftware

  • Step Up Labs, Inc.
  • Prague
View GitHub Profile
private async Task LoginAsync(string lng)
{
// skip onboarding
Keyboard.SendKeys("{Escape}");
// set locale
this.UIMap.UISettleUpWindow.LocaleTextBox.Text = lng;
// email login
var email = $"screenshots-{lng}@settleup.io";
[TestMethod] public async Task LoginAndTakeScreenshotsFiAsync() => await this.LoginAndTakeScreenshotsAsync("cs-CZ");
[TestMethod] public async Task LoginAndTakeScreenshotsDeAsync() => await this.LoginAndTakeScreenshotsAsync("de");
//... other languages
public async Task LoginAndTakeScreenshotsAsync(string lng)
{
var window = XamlWindow.Launch("app-automation-id");
// 1) main screen
await this.LoginAsync(lng, email);
<!-- Android strings.xml: -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="settle_debts">Vyrovnat dluhy</string>
<string name="report">Nahlásit</string>
</resources>
<!-- UWP ResX: -->
<?xml version="1.0" encoding="utf-8"?>
<root>
function Convert-StringsToResX([string] $strings)
{
[xml]$xml = Get-Content -Path $strings -Encoding UTF8
Write-ResXHeader
# android strings
$nodes = $xml.SelectNodes("/resources/string")
foreach ($node in $nodes)
{
@bezysoftware
bezysoftware / desinger-generator.ps1
Last active September 9, 2018 08:00
Designer generator
function Convert-Everything([string] $rootDir, [string[]]$languages)
{
$resources = "$rootDir"
$neutralStrings = "$resources/strings.xml"
# generate appresources.designer.cs file
Write-DesignerFile $neutralStrings $neutralResx | Out-File -FilePath 'AppResources.Designer.cs'
# generate neutral appresources.resx
Convert-StringsToResX $neutralStrings $neutralResx | Out-File -FilePath 'AppResources.resx' -encoding utf8
@bezysoftware
bezysoftware / plurals-designer.cs
Last active September 9, 2018 08:21
Plurals designer sample
public string OrangesOne => ResourceManager.GetString("oranges_one", this.resourceCulture);
public string OrangesFew => ResourceManager.GetString("oranges_few", this.resourceCulture);
public string OrangesOther => ResourceManager.GetString("oranges_other", this.resourceCulture);
public string OrangesWithCount(int count) {
var key = "";
switch (count)
{
case 1:
// one orange
@bezysoftware
bezysoftware / strings-plurals.kt
Last active September 6, 2018 09:44
Strings plural usage in Kotlin
val count = getNumberOfOrangesAvailable()
val orangesFound = resources.getQuantityString(R.plurals.numberOfOrangesAvailable, count, count)
@bezysoftware
bezysoftware / strings-plurals.xml
Last active September 6, 2018 09:45
Android plural forms sample
<?xml version="1.0" encoding="utf-8"?>
<resources>
<plurals name="numberOfOrangesAvailable">
<item quantity="one">%d pomeranč.</item>
<item quantity="few">%d pomeranče.</item>
<item quantity="other">%d pomerančů.</item>
</plurals>
</resources>