Hello,
I added mysite/javascript/lang/ru_RU.js and flushed website, but still sapphire/javascript/lang/en_US.js load?
public function init() {
...
Requirements::clear();
}
doesn't help
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hello,
I added mysite/javascript/lang/ru_RU.js and flushed website, but still sapphire/javascript/lang/en_US.js load?
public function init() {
...
Requirements::clear();
}
doesn't help
and as addition how to form structure like that:
<% if Object.Method() == bla-bla %>
<% end_if %>
i know that i can use:
<% control Object %>
<% if Method() == bla-bla %>
<% end_if %>
<% end_contol %>
but it looks odd
I think I'm having similar issue here. Am on SS 2.4.0
Have added $SearchForm in my template and in _config.php:
FulltextSearchable::enable();
Translatable::set_default_locale('nl_NL');
Object::add_extension('SiteTree', 'Translatable');
i18n::set_locale('nl_NL');
Have added following line in mysite/lang/nl_NL.php:
<?php
$lang['nl_NL']['SearchForm']['SEARCH'] = 'Test';
?>
Now on the site (even with ?locale=nl_NL) the default search form value is taken from saphire/lang/nl_NL.php and not from mysite/lang/nl_NL.php. Newly created $lang rows (i.e. lang definitions not present in saphire/lang/nl_NL.php) in mysite/lang/nl_NL.php do work however.
Is it not possible to overload saphire/lang/nl_NL.php?
PS. This is in my Page.php:
public function init() {
parent::init();
// Set locale
if($this->dataRecord->hasExtension('Translatable')) {
i18n::set_locale($this->dataRecord->Locale);
}
...
It's default locale as fallback: sapphire/javascript/i18n.js but u can block it Requirements::block('sapphire/javascript/i18n.js');
Requirements::add_i18n_javascript('<my-module-dir>/javascript/lang');
Fixed this by creating folder zlang in root. Contents of this folder is empty _config.php (with <?php ?>) and lang folder with language files. Think I found this trick on ssbits.