Hi,
I've been stuck with this for a couple of days now. I've been following the translatable and i18n documentation and tutorials, but it seems like I'm still missing something.
SiteTree translations work fine, and I have a working language switcher in place too. My problem is that we have some hardcoded string directly in the template files and I'm not getting anywhere near to get them translated,
Here's my configuration: (site needs EN and FR)
_config.php:
i18n::set_locale('en_US');
Translatable::set_default_locale('en_US');
SiteConfig::add_extension('Translatable');
..
Page.php
class Page_Controller extends ContentController {
public function init() {
parent::init();
// set locale for each page
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
I have fr_FR.php and en_US.php files
<?php
global $lang;
$lang['fr_FR']['ProductCategoryPage']['HEADING'] = 'fr text.';
?>
and
<?php
global $lang;
$lang['en_US']['ProductCategoryPage']['HEADING'] = 'en text.';
?>
and the template has: <%t ProductCategoryPage.HEADING %>
but I don't get the string anything on the browser.
I added phpUnit to my composer file, but I'm still greatly confused with the text collector.
I would greatly appreciate any help