Skip to content

Commit 828f4e9

Browse files
authored
Switch from Phrase to Lokalise (#177)
1 parent 966b8cb commit 828f4e9

File tree

20 files changed

+2745
-3897
lines changed

20 files changed

+2745
-3897
lines changed

.phrase.yml

Lines changed: 0 additions & 130 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ All notable changes to this project will be documented in this file.
33

44
## UNRELEASED
55
### Added
6+
* ui/ui-toolkit: i18n using the Lokalise
67
### Changed
78
* ui: The `ProductResolver.Builder` now requires a project as constructor param, since the default value has been removed
89
### Removed
10+
* ui: Remove phrase for i18n
911
### Fixed
1012
* core: Handle `SQLiteDatabaseLockedException` to fix app crash when updating the database
1113
* ui: Avoid npe caused by `isEmpty()` check on a null shopping cart

kotlin-sample/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ android {
1818
versionCode = 1
1919
versionName = "1.0"
2020

21+
resourceConfigurations.addAll(listOf("de", "en"))
2122
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2223
}
2324

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<resources>
3-
<string name="Dashboard.text">Besuche eine unterstütze Filiale, um mit Snabble einzukaufen!</string>
4-
<string name="Dashboard.title">Willkommen bei Snabble</string>
5-
<string name="home">Start</string>
6-
<string name="Onboarding.accept">Akzeptieren</string>
7-
<string name="Onboarding.message1">Mit Snabble scannst du deinen Einkauf selbst und bezahlt direkt in der App. Ohne in der Schlange zu stehen und ohne deinen Einkauf auf’s Band zu legen.</string>
8-
<string name="Onboarding.message2">Betrete eine teilnehmende Filiale, starte den Einkauf und halte den Barcode eines Artikels vor die Kamera. Der Rest erklärt sich von selbst.</string>
9-
<string name="Onboarding.message3">Bitte akzeptiere die Nutzungsbedingungen und lies die Datenschutzhinweise.</string>
10-
<string name="profile">Profil</string>
11-
<string name="Profile.customerCard">Kundenkarte</string>
12-
<string name="Profile.deleteAccount">Account löschen</string>
13-
<string name="Profile.developerMode">Entwickler-Einstellungen</string>
14-
<string name="Profile.environment">Umgebung</string>
15-
<string name="Profile.Environment.production">Production</string>
16-
<string name="Profile.Environment.staging">Staging</string>
17-
<string name="Profile.Environment.testing">Testing</string>
18-
<string name="Profile.header">Dein Profil</string>
19-
<string name="Profile.imprint">Impressum</string>
20-
<string name="Profile.lastPurchases">Vorherige Einkäufe</string>
21-
<string name="Profile.legalNotes">Rechtliche Hinweise</string>
22-
<string name="Profile.licences">Lizenzen</string>
23-
<string name="Profile.paymentMethods">Zahlungsmethoden</string>
24-
<string name="Profile.privacy">Datenschutzerklärung</string>
25-
<string name="Profile.pushMessages">Push-Benachrichtigungen</string>
26-
<string name="Profile.resetAppID">AppID zurücksetzen</string>
27-
<string name="Profile.resetClientID">Client ID zurücksetzen</string>
28-
<string name="Profile.saveEnergy">Strom sparen</string>
29-
<string name="Profile.settings">Einstellungen</string>
30-
<string name="Profile.showOnboarding">Zeige Onboarding</string>
31-
<string name="Profile.terms">Nutzungsbedingungen</string>
32-
<string name="scanner">Scanner</string>
33-
<string name="shoppingCart">Warenkorb</string>
34-
<string name="shops">Filialen</string>
3+
<string name="Dashboard.text">Besuche eine unterstütze Filiale, um mit Snabble einzukaufen!</string>
4+
<string name="Dashboard.title">Willkommen bei Snabble</string>
5+
<string name="Onboarding.accept">Akzeptieren</string>
6+
<string name="Onboarding.message1">Mit Snabble scannst du deinen Einkauf selbst und bezahlt direkt in der App. Ohne in der Schlange zu stehen und ohne deinen Einkauf auf’s Band zu legen.</string>
7+
<string name="Onboarding.message2">Betrete eine teilnehmende Filiale, starte den Einkauf und halte den Barcode eines Artikels vor die Kamera. Der Rest erklärt sich von selbst.</string>
8+
<string name="Onboarding.message3">Bitte akzeptiere die Nutzungsbedingungen und lies die Datenschutzhinweise.</string>
9+
<string name="Profile.Environment.production">Produktion</string>
10+
<string name="Profile.Environment.staging">Staging</string>
11+
<string name="Profile.Environment.testing">Testing</string>
12+
<string name="Profile.customerCard">Kundenkarte</string>
13+
<string name="Profile.deleteAccount">Account löschen</string>
14+
<string name="Profile.developerMode">Entwickler-Einstellungen</string>
15+
<string name="Profile.environment">Umgebung</string>
16+
<string name="Profile.header">Dein Profil</string>
17+
<string name="Profile.imprint">Impressum</string>
18+
<string name="Profile.lastPurchases">Vorherige Einkäufe</string>
19+
<string name="Profile.legalNotes">Rechtliche Hinweise</string>
20+
<string name="Profile.licences">Lizenzen</string>
21+
<string name="Profile.paymentMethods">Zahlungsmethoden</string>
22+
<string name="Profile.privacy">Datenschutzerklärung</string>
23+
<string name="Profile.pushMessages">Push-Benachrichtigungen</string>
24+
<string name="Profile.resetAppID">AppID zurücksetzen</string>
25+
<string name="Profile.resetClientID">Client ID zurücksetzen</string>
26+
<string name="Profile.saveEnergy">Strom sparen</string>
27+
<string name="Profile.settings">Einstellungen</string>
28+
<string name="Profile.showOnboarding">Zeige Onboarding</string>
29+
<string name="Profile.terms">Nutzungsbedingungen</string>
30+
<string name="home">Start</string>
31+
<string name="profile">Profil</string>
32+
<string name="scanner">Scanner</string>
33+
<string name="shoppingCart">Warenkorb</string>
34+
<string name="shops">Filialen</string>
3535
</resources>
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<resources>
3-
<string name="Dashboard.text">Visit a supported store to shop with Snabble!</string>
4-
<string name="Dashboard.title">Welcome to Snabble</string>
5-
<string name="home">Start</string>
6-
<string name="Onboarding.accept">Agree</string>
7-
<string name="Onboarding.message1">Using Snabble, you scan your purchase yourself and pay directly in the app. No queueing and without putting your purchase on the belt.</string>
8-
<string name="Onboarding.message2">Enter a participating store, start shopping and hold the barcode of an article in front of the camera. The rest is self-explanatory.</string>
9-
<string name="Onboarding.message3">Please accept the terms of use and take note of the privacy policy.</string>
10-
<string name="profile">Profile</string>
11-
<string name="Profile.customerCard">Customer Card</string>
12-
<string name="Profile.deleteAccount">Delete Account</string>
13-
<string name="Profile.developerMode">Developer Settings</string>
14-
<string name="Profile.environment">"Environment "</string>
15-
<string name="Profile.Environment.production">Production</string>
16-
<string name="Profile.Environment.staging">Staging</string>
17-
<string name="Profile.Environment.testing">Testing</string>
18-
<string name="Profile.header">Your Profile</string>
19-
<string name="Profile.imprint">Imprint</string>
20-
<string name="Profile.lastPurchases">Last Purchases</string>
21-
<string name="Profile.legalNotes">Legal Notes</string>
22-
<string name="Profile.licences">Licences</string>
23-
<string name="Profile.paymentMethods">Payment Methods</string>
24-
<string name="Profile.privacy">Privacy Policy</string>
25-
<string name="Profile.pushMessages">Push Messages</string>
26-
<string name="Profile.resetAppID">Reset AppID</string>
27-
<string name="Profile.resetClientID">Reset Client ID</string>
28-
<string name="Profile.saveEnergy">Save energy</string>
29-
<string name="Profile.settings">Settings</string>
30-
<string name="Profile.showOnboarding">Show Onboarding</string>
31-
<string name="Profile.terms">Terms</string>
32-
<string name="scanner">Scanner</string>
33-
<string name="shoppingCart">Shopping Cart</string>
34-
<string name="shops">Shops</string>
3+
<string name="Dashboard.text">Visit a supported store to shop with Snabble!</string>
4+
<string name="Dashboard.title">Welcome to Snabble</string>
5+
<string name="Onboarding.accept">Agree</string>
6+
<string name="Onboarding.message1">Using Snabble, you scan your purchase yourself and pay directly in the app. Without standing in line and without putting your purchase on the conveyor belt.</string>
7+
<string name="Onboarding.message2">Enter a participating store, start shopping and hold the barcode of an article in front of the camera. The rest is self-explanatory.</string>
8+
<string name="Onboarding.message3">Please accept the terms of use and take note of the privacy policy.</string>
9+
<string name="Profile.Environment.production">Production</string>
10+
<string name="Profile.Environment.staging">Staging</string>
11+
<string name="Profile.Environment.testing">Testing</string>
12+
<string name="Profile.customerCard">Customer Card</string>
13+
<string name="Profile.deleteAccount">Delete Account</string>
14+
<string name="Profile.developerMode">Developer Settings</string>
15+
<string name="Profile.environment">Environment</string>
16+
<string name="Profile.header">Your Profile</string>
17+
<string name="Profile.imprint">Imprint</string>
18+
<string name="Profile.lastPurchases">Last Purchases</string>
19+
<string name="Profile.legalNotes">Legal Notes</string>
20+
<string name="Profile.licences">Licenses</string>
21+
<string name="Profile.paymentMethods">Payment Methods</string>
22+
<string name="Profile.privacy">Privacy Policy</string>
23+
<string name="Profile.pushMessages">Push Messages</string>
24+
<string name="Profile.resetAppID">Reset AppID</string>
25+
<string name="Profile.resetClientID">Reset Client ID</string>
26+
<string name="Profile.saveEnergy">Save energy</string>
27+
<string name="Profile.settings">Settings</string>
28+
<string name="Profile.showOnboarding">Show Onboarding</string>
29+
<string name="Profile.terms">Terms</string>
30+
<string name="home">Start</string>
31+
<string name="profile">Profile</string>
32+
<string name="scanner">Scanner</string>
33+
<string name="shoppingCart">Shopping Cart</string>
34+
<string name="shops">Shops</string>
3535
</resources>

lokalise.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env zsh
2+
#
3+
# Lokalise CLI v2 can be found here: https://github.com/lokalise/lokalise-cli-2-go
4+
#
5+
# Setting the environment variable LOKALISE_ACCESS_TOKEN is necessary to execute this script.
6+
7+
function lokalise {
8+
lokalise2 \
9+
--token $LOKALISE_ACCESS_TOKEN \
10+
--project-id $1 \
11+
file download \
12+
--format xml \
13+
--unzip-to $2 \
14+
--export-empty-as skip \
15+
--include-description=false \
16+
$@
17+
}
18+
19+
# ui
20+
lokalise 3931709465f04f20a1bc18.55914019 ui/src/main/res --exclude-tags Onboarding,Shop,Scanner
21+
22+
# ui-toolkit
23+
lokalise 3931709465f04f20a1bc18.55914019 ui-toolkit/src/main/res --include-tags Onboarding,Shop,Scanner
24+
25+
# sample app
26+
lokalise 8964099365f434ac71f546.06213099 kotlin-sample/src/main/res

0 commit comments

Comments
 (0)