Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run package with languages lacking language codes? #23

Closed
TJMusiitwa opened this issue Jun 23, 2020 · 3 comments
Closed

Run package with languages lacking language codes? #23

TJMusiitwa opened this issue Jun 23, 2020 · 3 comments

Comments

@TJMusiitwa
Copy link

Hey there so there's this application that I am building that is meant to relay information in a number of languages given that it's to serve a country of multi languages and while some languages will come off as easy e.g. Swahili, English, kinyarwanda, Arabic etc... There are some languages that don't have common language codes...

So I was wondering if this package will be able to run with languages where I am able to provide all the translations but don't have language codes (can I be able to define my own codes)

PS some of these are languages supported by Google even in search?

@defuncart
Copy link
Collaborator

@TJMusiitwa This package should work with the following language codes and any regional variants (i.e. en_GB, en_US).

However, even if a language isn't here included (for instance ga, Gaeilge/Irish), it can still be loaded by flappy using I18n.load(Locale('ga'). In this case, you could initially set the app's default language to device language or a fallback (i.e. English), and allow the user to change the language in settings.

With regard to defining your own codes, please report back if this works! It seems possible using the ga example above.

Hope this (somewhat) answers your question.

@defuncart
Copy link
Collaborator

@TJMusiitwa I can confirm that custom language codes or does not supported by Google in Flutter can be loaded using flappy_translator, for instance, ga_IE or cy_GB.

As mentioned here, your app, however, will crash if you do not have a GlobalMaterialLocalizations delegate for these languages. Here is an example of a custom GlobalMaterialLocalizations delegate, while here is an app that I'm developing which is localized in ga and cy, two languages not supported by default.

@defuncart
Copy link
Collaborator

Closing issue as original question has been answered. Please re-open if you experience any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants