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
[Proposal]Allow multiple arb files to organize l10n / intl localizations for a language #107157
Comments
Hi @golane-august, Thanks for filing the issue. That looks like a valid feature request. |
It's also a must have from my point of view. However, I think things could be even more improved than @golane-august suggestion. Example of app structure I have in mind:
If needed, we may use special attributes of arb files, @@ locale and @@ context described at https://github.com/google/app-resource-bundle/wiki/ApplicationResourceBundleSpecification See also this issue/comment, showing we are not the only ones interested by cleaning our arb files : #71729 (comment) |
@sbatezat I don't really agree on that. Although it would be nice to have more flexibility, it may is a bad idea everyone cooks their own soup. I more like the idea of having reusable strings (e.g. such as for buttons like |
I want to make this. |
Agree, would be much easier to maintain if we could split it up into feature specific arb files |
up |
One more thumb-up to get localisation gens separated. Could you manage to generate Localisation per feature(arb file). |
There doesn't seem to be anyone assigned to this. Maybe this is something the community could take on ? |
We would also like something like this, akin to .NET resource files. We have quite a large app with multiple flavours, for different customers (of which some want multi-lingual, others don't) - and would like to be able to have feature-specific resources, flavour-specific resources, and just a bit of organisation. Otherwise we end up with thousands of fields in a single file and have to manage namespacing the keys ourselves. Would be quite nice even just to be able to simply have multiple .arb files and a parent file that lists which ones to include in the release. |
This really needs to be done as it will be difficult to maintain the translation without it |
Hey everyone, I've started working on this and already created a draft. You can check it out there. The part that generates the localizations with a namespace is already working. I plan to finish it by the end of next week. |
good, hope we can use it in early 2024. |
Any updates on this? |
The PR is stale. Someone can take it over #137307 |
Use case
In the current app development, you cannot split your localizations into multiple files to better categorize them. You also don't have the ability to add comments to JSON files in order to better separate the categories.
In Flutter itself you also have multiple files for the different packages.
See also docs for localization.
Question is also asked on Stackoverflow with no good answer yet.
Dart package is claimed to support multiple arb files: https://pub.dev/packages/intl_translation
Proposal
.arb
files with the same suffixdart
file if notemplate-arb-file
is specified inl10n.yaml
file or/and allow wildcard for this parameter:template-arb-file: "*_en.arb"
The relevant changes could be made here.
The text was updated successfully, but these errors were encountered: