There is a code added somewhere amongst Wordpress theme php files:
function functionFunction() {
var ts = CRM.ts();
theButton =
"<a id=thebutton href=/civicrm/contribute/transact/?reset=1&id=6>"
+ ts("The Button to translate")
+ "</a>";
return theButton;
}
A website is multisite + multilingual ( and none of the languages is English ), therefore The Button to translate needs to be translated to all enabled languages and be preserved during l10n updates.
There are some recipies here https://explore.transifex.com/civicrm/civicrm/ and and here https://docs.civicrm.org/dev/en/latest/extensions/translation/#for-developers-generate-po-and-mo-files-for-your-extension and also here https://github.com/civicrm/civistrings and there How to add additional custom translation for a payment processor?.
However none of these addresses the situation where we need to translate a few lines of text without messing with MO/PO, gettext/poedit, etc., etc. It looks like the closest one could get is to create an "empty" extension, the single purpose of which would be MO files accommodation - and even in this case we need to "merge" the extension translation file with the rest of it, which seems to be a bit too much for a small amount of text.
Am I missing something here? Any alternatives/workarounds/hacks/fast&dirty tricks?
functions.php
... okay... so @Demerit's answer should work, but I can add an alternative that references the WordPress locale (since that's the canonical one) if that helps?