Translations for CB plugins - where/how?

10 years 8 months ago #231539 by zerodd
Hi,

we are integrating the CB Subs plugin into a site for our client in Italian, and would love to centralize our Italian translations for this part of the site (beyond the things you can input in the backend, which is a lot but far from everything).

Given that the plug_cbpaidsubscriptions code contains instances like this:

CBPTXT::Th("%s's current and past %s")

or

CBPTXT::T('something something');

it seems that there is a mechanism for replacing these with a translation. Only problem is I can't find where to put this for CB Subs-specific translations.

We do have a file in com_comprofiler/plugins/language called italian.php which contains constants that are (correctly) translated to Italian for 'regular' community builder features:

DEFINE('_UE_HITS','Visite');

Changing stuff like that works. However, adding a line like:
DEFINE("Access to this content is not allowed without %s", 'Accesso vietato senza %s.');

Does not seem to get picked up by CB Subs.

SO IN SUMMARY, THE QUESTION:
which file/location do the CBPTXT::Th("original phrase") and CBPTXT::T("original phrase") go look in, so that if I add to this file DEFINE("original english phrase", 'frase tradotto in italiano'); or something similar (the convention is some .ini file though you guys seem to do it differently) it will come out as 'frase tradotto in italiano'?

(currently they obviously always fall back on the input phrase, i.e. the english one).

Thanks guys!

Please Log in to join the conversation.

10 years 8 months ago #231542 by krileon
Replied by krileon on topic Translations for CB plugins - where/how?
CBTxt usages are in cbteamplugin for CB language plugins. For CBSubs it only uses CBTxt usages so its language.php file is nothing but CBTxt translations (same for GJ). You can see how CBTxt strings are translated within the below.

/components/com_comprofiler/plugin/language/default_language/cbteamplugins_language.php


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

10 years 8 months ago #231579 by zerodd
Replied by zerodd on topic Translations for CB plugins - where/how?
Thanks krileon!

Your suggestion (and some variants on it, like changing the file in the 'italian' folder) did not work, however, for future readers: we got CB Subs translations working by installing the cbsubs language plugin, which creates a new folder com_comprofiler/plugin/language/cbpaidsubscriptions-en-gb, and then duplicating that one with name language-it-it (so that our site with global language config IT caught it).

Please Log in to join the conversation.

10 years 8 months ago #231587 by krileon
Replied by krileon on topic Translations for CB plugins - where/how?
"italian" folder usage is for Mambo, J1.0, and J1.5 usage. "it-it" is needed for J2.5 and J3.0 usage as they won't return a language name anymore and only a language tag. Information on this and also how to create a new language plugin can be found below.

forge.joomlapolis.com/projects/lan-cb/wiki

More on language usage can also be found below.

www.joomlapolis.com/cb-solutions/languages


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.175 seconds

Facebook Twitter LinkedIn