Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #367 from OkunaOrg/release/0.0.51
Browse files Browse the repository at this point in the history
Release/0.0.51
  • Loading branch information
lifenautjoe committed Aug 15, 2019
2 parents 1b6c8ad + e15fe1b commit dd1a8e1
Show file tree
Hide file tree
Showing 164 changed files with 35,328 additions and 1,311 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ android/.idea
/codesigndoc_exports
Appfile
report.xml
/crowdin.yml
Empty file added Pipfile
Empty file.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,43 @@ flutter run --profile

1. Add localization string get method to `openbook_app/lib/services/localizations.dart`
2. Run `make generate_locale`
3. Upload assets/i18n/en folder's contents to crowdin
3. Upload assets/i18n/en folder's contents to https://crowdin.com/project/okuna/settings#files by pressing `Update` next to the existing files.
4. Apply the translations on crowdin, then build and download
5. Copy the contents of the downloaded archive to assets/i18n
6. Run `make build_locale`

### 7.c Localized Locales
At Okuna, we wanted to support different combinations of languages and country codes. For eg.
Someone could want Brazilian Portugese as their language but choose country Netherlands since they live there. The country could be relevant
for location relevant content, payments etc. while the language is just what the user prefers.

Most locale frameworks only allow locale `pt,BR` which means Brazilian portuguese but this also sets the country code in the locale
object to Brazil which may not always be the case.

Therefore, localized locales are locales that have a language code that looks like this for eg. `pt-BR` and in addition also a country code. Which makes the locale object
`Locale('pt-BR', 'BR);` Our API supports many such languages which have different localized versions and we can add new languages as required.


While looking for loading locale files when a locale change takes place, the `intl` library converts a locale to a canonical name where dashes in language codes become underscores.
The canonical names for `Locale('nl','NL')` would be `nl_NL`, ie `languageCode_countryCode`. The `intl` package, first looks for if a language
exists with that and if not found, next splits this on the underscore and looks for `nl`.

With our custom localizedLocales, `intl` library converts this to `pt_BR_BR`. This confuses the `intl` package as the language is stored with it as `pt_BR`.
(See method `__findExact` in the auto-generated file `messages_all.dart` for in-depth code) . To deal with locale changes, we maintain a `localizedLocales` list in the `localization.dart` service which tells the
localization service to only pass along `pt_BR`to `intl` when it encounters a localizedLocale. This ensures it finds the right match and loads the locale.

In addition,a small note, we convert the `Accept-language` header in `httpie.dart` to lowercase since django expects it like that and this header is case sensitive. So django will not recognise
`pt-BR` but recognises `pt-br`.

## To onboard a new language

1. Create a folder in i18n with the localized language code, for.eg `pt-BR` and store the arb files there.
2. Add the localized locale in lib/translation/constants.dart
3. If the language code contains 2 parts (e.g. language_country), add the localized locale code to the `localizedLocales` list in `localization.dart`.
4. If the language code contains 2 parts (e.g. language_country), create a `lang_country_localization_delegate.dart`. See `lib/delegates/pt_br_material_localizations.dart` for example.
4.2 Add the delegate in the main.dart file
5. Run `make build_locale` as is standard.

### 8. Contribute!

Help us keep Okuna going! Please look into our open issues. All contribution, no matter how small, makes a big difference.
Expand Down
34 changes: 17 additions & 17 deletions assets/i18n/de/auth.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"headline": "Besser sozial.",
"headline": "Better social.",
"@headline": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -41,7 +41,7 @@

}
},
"username_maxlength_error": "Ein Benutzername darf nicht l盲nger als {maxLength} Zeichen sein.",
"username_maxlength_error": "Ein Benutzername darf nicht mehr als {maxLength} Zeichen haben.",
"@username_maxlength_error": {
"type": "text",
"placeholders": {
Expand All @@ -57,15 +57,15 @@

}
},
"create_acc__lets_get_started": "Fangen wir an",
"create_acc__lets_get_started": "Los geht's",
"@create_acc__lets_get_started": {
"type": "text",
"placeholders": {

}
},
"create_acc__welcome_to_alpha": "Willkommen in der Alpha!",
"@create_acc__welcome_to_alpha": {
"create_acc__welcome_to_beta": "Willkommen zur Beta!",
"@create_acc__welcome_to_beta": {
"type": "text",
"placeholders": {

Expand Down Expand Up @@ -172,7 +172,7 @@

}
},
"description_range_error": "Beschreibung muss zwischen {minLength} und {maxLength} Zeichen sein.",
"description_range_error": "Beschreibung muss zwischen {minLength} und {maxLength} Zeichen lang sein.",
"@description_range_error": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -261,7 +261,7 @@

}
},
"create_acc__name_length_error": "馃槺 Dein Name darf nicht l盲nger als 50 Zeichen sein. (Wenn er das ist, entschuldigen wir uns sehr.)",
"create_acc__name_length_error": "馃槺 Dein Name darf nicht l盲nger als 50 Zeichen lang sein. (Wenn er das tats盲chlich ist, tut uns das sehr leid.)",
"@create_acc__name_length_error": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -317,21 +317,21 @@

}
},
"create_acc__username_server_error": "馃槶 Wir haben derzeit Probleme mit unseren Servern, versuch es in ein paar Minuten erneut.",
"create_acc__username_server_error": "馃槶 Ein Serverproblem ist aufgetreten, bitte versuche es sp盲ter noch einmal.",
"@create_acc__username_server_error": {
"type": "text",
"placeholders": {

}
},
"create_acc__what_email": "Was ist deine E-Mail?",
"create_acc__what_email": "Wie lautet deine E-Mail?",
"@create_acc__what_email": {
"type": "text",
"placeholders": {

}
},
"create_acc__email_placeholder": "fritz_fantom@mail.com",
"create_acc__email_placeholder": "fritz_fantom@mail.de",
"@create_acc__email_placeholder": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -359,7 +359,7 @@

}
},
"create_acc__email_server_error": "馃槶 Wir haben derzeit Probleme mit unseren Servern, versuch es in ein paar Minuten erneut.",
"create_acc__email_server_error": "馃槶 Ein Serverproblem ist aufgetreten, bitte versuche es sp盲ter noch einmal.",
"@create_acc__email_server_error": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -420,14 +420,14 @@

}
},
"create_acc__avatar_choose_camera": "Ein Foto machen",
"create_acc__avatar_choose_camera": "Foto aufnehmen",
"@create_acc__avatar_choose_camera": {
"type": "text",
"placeholders": {

}
},
"create_acc__avatar_choose_gallery": "Ein bestehendes Foto verwenden",
"create_acc__avatar_choose_gallery": "Vorhandenes Bild ausw盲hlen",
"@create_acc__avatar_choose_gallery": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -483,14 +483,14 @@

}
},
"create_acc__submit_error_desc_server": "馃槶 Wir haben derzeit Probleme mit unseren Servern, versuch es in ein paar Minuten erneut.",
"create_acc__submit_error_desc_server": "馃槶 Ein Serverproblem ist aufgetreten, bitte versuche es sp盲ter noch einmal.",
"@create_acc__submit_error_desc_server": {
"type": "text",
"placeholders": {

}
},
"create_acc__submit_error_desc_validation": "馃槄 Es sieht so aus, als ob einige Informationen nicht korrekt waren, 眉berpr眉fe diese und versuch es erneut.",
"create_acc__submit_error_desc_validation": "馃槄 Es sieht so aus, als ob einige Informationen nicht korrekt waren. 脺berpr眉fe diese und versuche es noch einmal.",
"@create_acc__submit_error_desc_validation": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -518,7 +518,7 @@

}
},
"create_acc__can_change_username": "Wenn du m枚chtest, kannst du es jederzeit 眉ber deine Profilseite 盲ndern.",
"create_acc__can_change_username": "Wenn du m枚chtest, kannst du ihn jederzeit 眉ber deine Profilseite 盲ndern.",
"@create_acc__can_change_username": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -644,7 +644,7 @@

}
},
"login__username_length_error": "Benutzername darf nicht l盲nger als 30 Zeichen sein.",
"login__username_length_error": "Benutzername darf nicht l盲nger als 30 Zeichen lang sein.",
"@login__username_length_error": {
"type": "text",
"placeholders": {
Expand Down
46 changes: 23 additions & 23 deletions assets/i18n/de/community.arb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

}
},
"button_staff": "Mitarbeiter",
"button_staff": "Team",
"@button_staff": {
"type": "text",
"placeholders": {
Expand All @@ -34,7 +34,7 @@

}
},
"communities": "communitys",
"communities": "Communities",
"@communities": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -69,7 +69,7 @@

}
},
"admin_desc": "Dies erm枚glicht dem Mitglied, die Community-Details, Administratoren, Moderatoren und gesperrte Benutzer zu bearbeiten.",
"admin_desc": "Dies erm枚glicht dem Mitglied, folgendes zu bearbeiten: Die Community-Details, Administratoren, Moderatoren und gesperrte Benutzer.",
"@admin_desc": {
"type": "text",
"placeholders": {
Expand All @@ -83,7 +83,7 @@

}
},
"admin_add_confirmation": "Bist du sicher, dass du @{username} als Administrator der Community hinzuf眉gen m枚chtest?",
"admin_add_confirmation": "Bist du sicher, dass du @{username} als einen Administrator der Community hinzuf眉gen m枚chtest?",
"@admin_add_confirmation": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -117,7 +117,7 @@
}
}
},
"moderator_desc": "Dies erm枚glicht dem Mitglied, die Community-Details, Moderatoren und gesperrte Benutzer zu bearbeiten.",
"moderator_desc": "Dies erm枚glicht dem Mitglied, folgendes zu bearbeiten: Die Community-Details, Moderatoren und gesperrte Benutzer.",
"@moderator_desc": {
"type": "text",
"placeholders": {
Expand All @@ -138,7 +138,7 @@

}
},
"leave_desc": "Du wirst keine Beitr盲ge dieser Community in deiner Timeline sehen, und auch keine Beitr盲ge mehr mit der Community teilen k枚nnen.",
"leave_desc": "Du wirst keine Beitr盲ge dieser Community in deiner Timeline sehen, und auch keine Beitr盲ge mehr mit dieser Community teilen k枚nnen.",
"@leave_desc": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -180,7 +180,7 @@

}
},
"delete_desc": "Du wirst keine Beitr盲ge dieser Community in deiner Timeline sehen, und auch keine Beitr盲ge mehr mit der Community teilen k枚nnen.",
"delete_desc": "Du wirst keine Beitr盲ge dieser Community in deiner Timeline sehen, und auch keine Beitr盲ge mehr mit dieser Community teilen k枚nnen.",
"@delete_desc": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -264,7 +264,7 @@

}
},
"manage_mod_reports_desc": "脺berpr眉fe die Community-Moderationsberichte.",
"manage_mod_reports_desc": "脺berpr眉fe die Meldungen an die Community.",
"@manage_mod_reports_desc": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -292,7 +292,7 @@

}
},
"manage_invite_desc": "Lade deine Verbindungen und Abonnenten ein, dieser Community beizutreten.",
"manage_invite_desc": "Lade deine Verbindungen und Follower ein, dieser Community beizutreten.",
"@manage_invite_desc": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -362,7 +362,7 @@

}
},
"refreshing": "Community aktualisieren",
"refreshing": "Community neu laden",
"@refreshing": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -464,7 +464,7 @@

}
},
"pick_upto_max": "Aufnahme von bis zu {max} Kategorien",
"pick_upto_max": "W盲hle bis zu {max} Kategorien",
"@pick_upto_max": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -493,7 +493,7 @@
}
}
},
"ban_user_title": "Benutzer sperren",
"ban_user_title": "Benutzer bannen",
"@ban_user_title": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -530,15 +530,15 @@

}
},
"favorite_community": "Favorisierte Community",
"favorite_community": "favorisierte Community",
"@favorite_community": {
"description": "Currently unsused, reserved for potential use. Could be used as Showing 1 favorite community",
"type": "text",
"placeholders": {

}
},
"favorite_communities": "Favorisierte Communitys",
"favorite_communities": "favorisierte Communities",
"@favorite_communities": {
"description": "Egs. Search favorite communities, See list_search_text in user_search.arb ",
"type": "text",
Expand Down Expand Up @@ -584,7 +584,7 @@

}
},
"moderated_communities": "moderierte Communitys",
"moderated_communities": "moderierte Communities",
"@moderated_communities": {
"description": "Egs. Search moderated communities, See list_search_text in user_search.arb ",
"type": "text",
Expand All @@ -607,15 +607,15 @@

}
},
"joined_communities": "Beigetretene Communitys",
"joined_communities": "Beigetretene Communities",
"@joined_communities": {
"description": "Egs. Search joined communities, See list_search_text in user_search.arb ",
"type": "text",
"placeholders": {

}
},
"join_communities_desc": "Werde Mitglied von Communitys und erlebe, wie diese Registerkarte zum Leben erwacht!",
"join_communities_desc": "Werde Mitglied von Communities und diese Registerkarte erwacht zum Leben!",
"@join_communities_desc": {
"type": "text",
"placeholders": {
Expand All @@ -629,7 +629,7 @@

}
},
"trending_none_found": "Keine Communitys im Trend gefunden. Versuche es in ein paar Minuten erneut.",
"trending_none_found": "Keine angesagten Communities gefunden. Versuche es in ein paar Minuten erneut.",
"@trending_none_found": {
"type": "text",
"placeholders": {
Expand All @@ -643,7 +643,7 @@

}
},
"trending_in_all": "In allen Kategorien angesagt",
"trending_in_all": "Angesagt in allen Kategorien",
"@trending_in_all": {
"type": "text",
"placeholders": {
Expand All @@ -659,7 +659,7 @@
}
}
},
"communities_title": "Communitys",
"communities_title": "Communities",
"@communities_title": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -710,7 +710,7 @@

}
},
"favorite_action": "Favorisierte Community",
"favorite_action": "Community favorisieren",
"@favorite_action": {
"type": "text",
"placeholders": {
Expand Down Expand Up @@ -894,7 +894,7 @@

}
},
"actions_invite_people_title": "Personen in die Community einladen",
"actions_invite_people_title": "Lade jemanden in die Community ein",
"@actions_invite_people_title": {
"type": "text",
"placeholders": {
Expand All @@ -915,7 +915,7 @@

}
},
"community_staff": "Community-Personal",
"community_staff": "Community-Team",
"@community_staff": {
"type": "text",
"placeholders": {
Expand Down

0 comments on commit dd1a8e1

Please sign in to comment.