-
Notifications
You must be signed in to change notification settings - Fork 12
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
Not detecting translation keys #95
Comments
Hey, |
I have a similar problem. Backend is Java and the i18n files are in "D:\Work\projectname\Server\src\main\resources\locale" in the subfolders "de" and "en". Inside are several json files (common.json, auth.json, payment.json, ...) with the usual key value pairs. Frontend is Vue and the files aren't loaded directly but within a REST response which is then injected into the i18n plugin. (I can't load them directly because they get merged with another remote file which can potentionally overwrite stuff, and we also only provide translations for pages where the user has access permissions). Regardless how I set the path in "Vue locales directory", the code occurences (e.g. I've tried relative and absolute paths, including the "de" folder and without. And I also added all filenames to "Default namespace" without any success. Am I using this incorrectly? |
Hi
As far as I see, your structure is like:
Here some points not clear to me: how does your translation keys gets resolved? Looks like key 'common.close' will try to get resolved by looking inside common.json, right? Maybe your intermediate REST merges all files common.json, auth, payment into one with correspondent root? |
Yes, the structure is correct. I initially load only a few basic message keys (in case the server won't respond) and after the REST response I call
(Actually it's even more complicated: We only return the messages relevant for the current selected language and active module, and the other modules and languages are loaded in a seperate request to optimize page loading speed) It's been so long since we have this setup, that I wasn't aware that the files are usually in a different structure. It just wouldn't be so convenient to have all modules inside one big file, and I can immagine situations where others may also want to load modules in a lazy way? One questions remains: How is the correct format of the "Vue locales directory" for the IntelliJ Idea plugin settings? Is it absolute? Or starting from root? With "./" in the beginning? With trailing slash? This is unclear from the documentation. |
Vue locales directory accepts just folder name, for example above it would be 'locale' - plugin will consider any 'locale' directory as a translation sources root, then it will try to find json files under this folder. |
Sure.. I provided you some information via email. |
I have enabled this plugin in iDE. The problem is our namespaces are different from the file names eg. Our folder structure is like
-src
-assets
-locales
-app_en.json
-app_de.json
Here my namespace is app. So in the plugin configuration when i input " app " as default namespace . My plugin does not work and tries to create file as app.json for the translations.
Can anybody help me how i can configure the plugin in my case.
The text was updated successfully, but these errors were encountered: