Forum

Thread tagged as: Question, Forms, Gallery

Translation keys

In e.g. /perch/addons/apps/perch_gallery/edit/?id=12, at the bottom of the page there's a submit button I've managed to localise to Dutch. However, right now this line states "Opslaan or Cancel".

Where exactly can I add a translation key for "or Cancel"?

Also, in e.g. /perch/addons/apps/perch_forms/responses/?id=2&spam=1, the pagination at the bottom hasn't been localised. Could you point me in the right direction where this can be localised? It's not using the pagination template here.

jrs rtmns

jrs rtmns 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Is your language file writable? If so, Perch should add any untranslated strings to it.

Yes it is.

In /modes/album.edit.post, line 50 now states:

echo $Form->submit_field('btnSubmit', PerchLang::get('Save'), $API->app_path());

I've added PerchLang::get('Save') in order to translate the button value, but the file has no mention of the words 'or cancel' - and I don't quite understand where this is being pulled from.

Drew McLellan

Drew McLellan 2638 points
Perch Support

It comes from the API.

I see. But there has to be an instance where I can simply overwrite those words, albeit hardcoded, right?

Drew McLellan

Drew McLellan 2638 points
Perch Support

They're not hardcoded - they're in the language files.

Well both the words 'or' and 'cancel' are indeed in the language files but they're not being used at that point - as if PerchLang::get isn't being used. Not sure what's going on. Managed to translate loads of instances throughout these addons, just can't seem to find these two.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which language file are you working in? The core or the app?

The core, my bad! Thank you very much for the pointer, problem solved!