cyon / vue-translation-manager

Interactively translate strings in Vue single file components
26 stars 12 forks source link

different key seperator #36

Open ghost opened 2 years ago

ghost commented 2 years ago

how can i choose another seperator for the keys - i have the problem that the default seperator '\' causes a lint error. Example:

generated in vue component: <div class="n-view-title">{{ $t('src\components\administration\user\index.title') }}</div>

generated in locals/en.json: { "src\\components\\administration\\user\\index": { "title": "New user" } }

this works of course but cause my linter to throw errors. A seperator like '.' instead of '\' would also work!

How can i change this?

MurtazinEduard commented 2 years ago

how did you solve this problem?

ghost commented 2 years ago

i just changed the code for myself:

in the bin.js file: line 180: var key = await manager.getSuggestedKey(filePath, str.string, usedKeys) i used the standard replace function to create a . instead of \

this did it for me..