idea-ngx-translate-autocomplete
idea-ngx-translate-autocomplete copied to clipboard
How to actually set up? Readme is not granular enough imo.
I just downloaded the plugin and played around with different settings. All keys are marked red as in "cannot resolve" in my code. I set up the folder and pointed to the specific JSON with the current translation in the settings but that didn't work. One comment on the JetBrains plugin website suggests you need to mark the translation folder as "resource" folder but neither was that stated anywhere in the readme nor did that do anything for me.
My current settings are:
- Absolute path to my
src/assets/i18nfolder as "Translation folder", - Absolute path to my actual json file in that folder as "Displayed translation".
I also tried just putting in the file name for the second one but that didn't work. As well as marking the whole assets folder or just the i18n folder as resource. Still nothing.
After fiddling around, i discovered that using an absolute path seems to work.
Somehow I didn't get the notification for this but @alberthaff for me, that didn't work either. My current settings are:
Translation folder: C:\[censored]\project-name\src\assets\i18n
Displayed translation: C:\[censored]\project-name\src\assets\i18n\en.json
An example JSON would be:
{
"status.new": "New"
}
But when I have an HTML file with something like {{'status.new' | translate}} it marks status.new red and says Cannot resolve symbol "status.new" (twice, for some reason).
Side note: It almost looks like it searches for the key with the " included, which would be quite wrong in the context of HTML.
The plugin is not looking for any quotes or something, it uses the IntelliJ JS framework to recognise the Angular expressions {{ 'hi' }} and pipes so this is not tied to this. It try to find a JSLitteralExpression before the pipe and retrieve the computed value, as long a there no computation with you key you should be good.
i think it may be linked to your translation file format but i do not have energy nor time to focus on the plugin as it works enough for my needs.
If you could link a git repo that reproduces your issue including the .idea config, I may easily find why and how fix your issue.