Skip to content

Commit

Permalink
Paywalls: adjusted German translations (#3476)
Browse files Browse the repository at this point in the history
Special abbreviation style for German and some corrections to the German
translation

The updated translations are more precise. For instance, "Datenschutz"
is a more commonly used term for "Privacy" in German. Similarly,
changing "Lebensdauer" to "Lebenslang" for "Lifetime" is more accurate,
as "Lebenslang" specifically implies 'for life'. The other changes
follow a similar pattern of refining the language for better
comprehension and context-appropriate usage in German.
  • Loading branch information
tensei authored Dec 6, 2023
1 parent 9fa27bd commit 5e9c4f7
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 6 deletions.
4 changes: 4 additions & 0 deletions RevenueCatUI/Data/Localization.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ private extension Localization {
switch locale.languageCodeIdentifier {
// Abbreviated does not fully work with Japanese
case "ja": return [.brief]
// Abbreviated is too short for German - Tag = T, Woche = Wo., Monat = M, Jahr = J
// In Brief Tag = Tg., Woche = Wo., Monat = Mo., Jahr = J the Year is just J, which is not very clear
// the full version is the best for German
case "de": return [.full]
default: return [.full, .brief, .abbreviated]
}
}
Expand Down
12 changes: 6 additions & 6 deletions RevenueCatUI/Resources/de.lproj/Localizable.strings
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"OK" = "OK";
"All subscriptions" = "Alle Abonnements";
"Privacy" = "Privatsphäre";
"Privacy" = "Datenschutz";
"Privacy policy" = "Datenschutzrichtlinie";
"Purchases restored successfully!" = "Einkäufe erfolgreich wiederhergestellt!";
"Purchases restored successfully!" = "Käufe erfolgreich wiederhergestellt!";
"Restore" = "Wiederherstellen";
"Restore purchases" = "Einkäufe wiederherstellen";
"Restore purchases" = "Käufe wiederherstellen";
"Terms" = "Bedingungen";
"Terms and conditions" = "Geschäftsbedingungen";
"Terms and conditions" = "Nutzungsbedingungen";
"Annual" = "Jährlich";
"6 Month" = "6 Monate";
"3 Month" = "3 Monate";
"2 Month" = "2 Monate";
"Monthly" = "Monatlich";
"Weekly" = "Wöchentlich";
"Lifetime" = "Lebensdauer";
"Lifetime" = "Lebenslang";
"%d%% off" = "%d %% Rabatt";
"Continue" = "Weitermachen";
"Continue" = "Weiter";
"Default_offer_details_with_intro_offer" = "Starten Sie Ihre Testversion für {{ sub_offer_duration }} und dann für {{ total_price_and_per_month }}.";
85 changes: 85 additions & 0 deletions Tests/RevenueCatUITests/LocalizationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,41 @@ class AbbreviatedUnitJapaneseLocalizationTests: BaseLocalizationTests {

}

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class AbbreviatedUnitGermanLocalizationTests: BaseLocalizationTests {

override var locale: Locale { return .init(identifier: "de_DE") }

func testDay() {
verify(.day, "Tag")
}

func testWeek() {
verify(.week, "Woche")
}

func testMonth() {
verify(.month, "Monat")
}

func testTwoMonths() {
verify(.init(2, .month), "2Monate")
}

func testThreeMonths() {
verify(.init(3, .month), "3Monate")
}

func testSixMonths() {
verify(.init(6, .month), "6Monate")
}

func testYear() {
verify(.year, "Jahr")
}

}

// MARK: - SubscriptionPeriod

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
Expand Down Expand Up @@ -161,6 +196,34 @@ class SubscriptionPeriodEnglishLocalizationTests: BaseLocalizationTests {

}

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class SubscriptionPeriodGermanLocalizationTests: BaseLocalizationTests {

override var locale: Locale { return .init(identifier: "de_DE") }

func testDayPeriod() {
verify(1, .day, "1 Tag")
verify(7, .day, "7 Tage")
}

func testsWeekPeriod() {
verify(1, .week, "1 Woche")
verify(3, .week, "3 Wochen")
}

func testMonthPeriod() {
verify(1, .month, "1 Monat")
verify(3, .month, "3 Monate")
verify(6, .month, "6 Monate")
}

func testYearPeriod() {
verify(1, .year, "1 Jahr")
verify(3, .year, "3 Jahre")
}

}

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class SubscriptionPeriodSpanishLocalizationTests: BaseLocalizationTests {

Expand Down Expand Up @@ -212,6 +275,28 @@ class PackageTypeEnglishLocalizationTests: BaseLocalizationTests {

}

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class PackageTypeGermanLocalizationTests: BaseLocalizationTests {

override var locale: Locale { return .init(identifier: "de_DE") }

func testLocalization() {
verify(.annual, "Jährlich")
verify(.sixMonth, "6 Monate")
verify(.threeMonth, "3 Monate")
verify(.twoMonth, "2 Monate")
verify(.monthly, "Monatlich")
verify(.weekly, "Wöchentlich")
verify(.lifetime, "Lebenslang")
}

func testOtherValues() {
verify(.custom, "")
verify(.unknown, "")
}

}

@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
class PackageTypeSpanishLocalizationTests: BaseLocalizationTests {

Expand Down

0 comments on commit 5e9c4f7

Please sign in to comment.