Set Fluent database #4
mayconfmelo
announced in
Tips
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Important: The following content applies to transl:0.2.0, which is still under development.
Fluent has many more localization options than those available when using the standard database. To use Fluent with
#transl, you need to individually import FTL files for each language, or set the entire Fluent database all at once; each approach has its pros and cons.Individual Fluent files
This approach allows to store data for each language in its own file; but also requires to manually import each file individually.
Note that the FTL file needs to be loaded with
#read, and an additionallangoption needs to be used to indicate the language.Complete Fluent database
This approach allows to set an entire Fluent database using only one command; but it also requires that the content of all Fluent files be contained within the same file — which can become quite large, depending on the size of the data and the number of languages used.
The YAML file used is similar to the one used in the standard database, however the
l10n: ftlentry is mandatory.Important
Each time
#transl(data)is used, the imported Fluent language data overwrites any existing Fluent data for those languages; therefore, if#translalready contains Fluent data for Spanish, importing new Fluent data for Spanish will overwrite it.This does not apply to the relationship between Fluent and standard data; it is possible to have Fluent data for Spanish and also standard data for Spanish in the same database.
If there are any questions, please explain them below and let's discuss!
All reactions