Locale from common library across extensions cannot be translated by language packs
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Feature Request
**Is your feature request related to a problem? Please describe.**
As I plan on creating multiple themes under [Afrux](https://github.com/afrux), I have a common library that contains changes which will be reused across those themes for easier maintenance and less repetitive code. All of which works well, except for locales.
Language packs include a wide range of translations for multiple extensions, and the corresponding extension locale files are loaded by checking the enabled extension IDs and matching that with those files. Which doesn't apply to such a library, so its translated locale file is never loaded from the language pack.
**Describe the solution you'd like**
One solution could be to provide a key for that library in the composer info of the extension, that key can be checked by the `LanguagePack` extender when deciding to load a locale file or not, and match its name to that key.
**Justify why this feature belongs in Flarum's core, rather than in a third-party extension**
While it might be possible to implement a solution in the extension itself to make it so that the locale file from the language pack that translates the library's locale is loaded, it'd only be a hack and not practical, this also sounds like a valid use case.
**Describe alternatives you've considered**
Hack some code on the extension's side.
Ref: afrux/asirem#5
Contributor guide
Research direction
Start by tracing the LanguagePack extender's locale-file loading decision and inspect the extension's composer info, as described in the issue. Determine how a shared library key could be represented and matched for translation loading, then verify that language packs load the library locale without breaking extension locale handling.
Written by the indexing model from the issue text.
Assessment
- Domain
- internationalization, localization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100