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

$locale/app.po hard-coded into locale compile script #49

Open
BusterNeece opened this issue Jul 22, 2023 · 1 comment
Open

$locale/app.po hard-coded into locale compile script #49

BusterNeece opened this issue Jul 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@BusterNeece
Copy link

Hey all! Thanks for your work in bringing this very useful tool to Vue 3.

I'm trying to use the JSON compiler tool to assist in building translations for my app, but I'm noticing that the paths for the individual locales are hard-coded in a few places.

In my case, my folder structure looks like:

translations
|  es_ES.UTF-8
|  |  LC_MESSAGES
|  |  |  default.po

I can override the folder name by just setting the locale name as es_ES.UTF-8/LC_MESSAGES (although that feels a little hacky), but the extractor hard-codes in the app.po path afterwards. That isn't the namespace I use for my translations, and renaming it would involve a lot of downstream difficulty.

Would it be possible to have the locales config optionally be a callback function returning the path for each locale's translation? Similar to the existing map call that's done on the library side, but checking if the config value is a function and then calling that instead to yield the locales to work with and their respective paths.

@BusterNeece BusterNeece changed the title $locale/app.po hard-coded into locale extract script $locale/app.po hard-coded into locale compile script Jul 22, 2023
@lzurbriggen lzurbriggen added the enhancement New feature or request label Jul 25, 2023
@lzurbriggen
Copy link
Collaborator

@BusterNeece

That isn't the namespace I use for my translations

the namespace and .po-file names don't have to match, do they? also check out flat: true in the output settings, maybe that fits your needs better.

we will consider adding something like this for the next major version that will have quite a few breaking changes, but i'm afraid we cannot justify investing much time in this project at the moment.

feel free to open a PR and implement it yourself if this is very important to you.

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

No branches or pull requests

2 participants