translate
translate copied to clipboard
Export: invalid csv file due to unwanted 'translations' from plugins
Hi,
I was trying the export/import functionality of the plugin but the import kept failing. After some digging I found out that it had to do with invalid data in the (generated) csv file. This was caused by some entries in the translation list retrieved from plugin files, like this:
-
AmNav.js (line:279 / plugin:amnav)
- Code:
var $elementContainer = this.$container.find('.amnav__node[data-id="'+parentId+'"]').closest('li'),
- Results in the following translation entry:
- Original: .amnav__node[data-id="
- Translation: .amnav__node[data-id="
- Code:
-
color.html (line:15 / plugin:amforms)
- Code:
{%- includejs 'new Craft.ColorPicker("'~(id|namespaceInputId)~'");' %}
- Results in the following translation entry:
- Original: new Craft.ColorPicker("
- Translation: new Craft.ColorPicker("
- Code:
So obviously the generated entries aren't exactly translations, so I don't understand why they are added to the translation list. As it says in this translate plugin documentation, only Craft::t(), Craft.t() and ""|t() should be read and manageable through the translate plugin.
Could someone look into this please? Thx in advance,
Just a thought, but isn't it 'safer' to just use the language files provided (if provided off course) by the plugin itself instead of scanning the plugin files for translations? In this example both amnav & amforms have specific translations files, so why don't make use of those?