lokalise / i18n-ally-jetbrains-docs

6 stars 4 forks source link

How to make the support for namespaces work? #19

Open LifeIsStrange opened 2 years ago

LifeIsStrange commented 2 years ago

Hi @terales @gvido-lokalise @beinarovic friendly ping :)

I would love to use this extension but I have the following problem: I have enabled namespaces in the extension (Vue).

I have the following structure: /lang/en/desktop.json /lang/en/mobile.json

/lang/fr/desktop.json /lang/fr/mobile.json

In vue template I want to access $t('desktop.card.description') but it instead erroneously autocomplete en.desktop.card.description... This make this extension unusable for our team :/ I have tested the same projet with the VScode version of i18n ally and after enabling support for namespaces (without having to specify any), the autocompletion work without showing en. I hope there is a way to make the extension work for this simple configuration :) Note that I have added desktop and mobile to the namespaces in the extension, also I do not specify /en in any input of the settings.

I can acess to /lan/g/en/desktop.json by putting en/%namespace%.json in the file template name template but then it will not index lang/fr/files.json As a reminder, this works out of the box in the VScode extenstion. Note that I am on webstorm and not Phpstorm

If I run a new extension profile, this time choosing autoconfiguration, my en folder is indexed (autocompletion works fine) (although it only scan one file, not the others from the folder) and more importantly my fr folder is not indexed.

btw the extension version shows 1.1.2 (I'm on Webstorm 2021.2.2 stable) but your website is outdated? (show latest version being 1.0.11)

note that even if I had no folder e.g /lang/desktop.json and embedded en: { } inside the json, the autocompletion also wrongfully show en.

terales commented 2 years ago

Hi! Given that you have a simple JSON like this:

{
  "someKey": "translation"
}

Then your preferences should look like that:

2021-11-03_17-04-43

Can you share how they look like in your case, please?


I can acess to /lan/g/en/desktop.json by putting en/%namespace%.json in the file template name template but then it will not index lang/fr/files.json

Plugin for JetBrains has no translation capabilities and would only work with one language at the moment.