Comments (17)
I wonder if its the case that language files in themes are not read, try moving it to mysite/lang/en.yml see if that works. Likely the manifest does not look in themes for language files.
from silverstripe-framework.
You're right! I moved YAML content into mysite YAML files and everything is ok, now. So it's a bug!
sake /dev/tasks/i18nTextCollectorTask
generates the english YAML file into themes/mySimple, but SS will never read it and it's translated counterpart.
from silverstripe-framework.
Ya i18nTextCollectorTask should be putting it into your site project for themes and not in the theme
from silverstripe-framework.
Maybe is better that theme folder is readed during translation, so it will be possible to translate templates.
from silverstripe-framework.
Main problem with that is that themes aren't interpreted like modules, which is what i18n uses to look up the available translations. If I'm correct i18n uses getModules() from the manifest see https://github.com/silverstripe/sapphire/blob/3.0/i18n/i18n.php#L1695 for example.
from silverstripe-framework.
You're right, but themes have to be translated in some way, so I think that's a quite big SS issue.
If you release a theme you can't publish it translate into 2 or more languages, and everyone installing it have to translate it manually.
from silverstripe-framework.
bump. any progress on this issue?
from silverstripe-framework.
Seems like this issue is solved in at least 3.1.6.
/dev/tasks/i18nTextCollectorTask?module=themes/mytheme collects stuff
/themes/mytheme/lang is noticed and translation files are added / used
from silverstripe-framework.
@wernerkrauss are you happy for us to close the issue, then?
from silverstripe-framework.
As @wernerkrauss stated this issue seems solved in 3.1.6
from silverstripe-framework.
It seems that the problem is still around in 3.1.8
from silverstripe-framework.
I confirm that this error persists on 3.1.8 version
from silverstripe-framework.
I've just tried this out in the 3.1 branch, works for me. Check i18n::include_by_locale()
, it does a scandir($themesBase)
- which has been there for a while (2011). One bug which might be related: i18n::get_existing_translations()
doesn't run the same checks on /themes
, so in cases where the locale ONLY exists in /themes
this might be an issue. Since your example uses it
, that's not applicable here though.
from silverstripe-framework.
I can confirm this bug. My /themes/mytheme/lang/nl.yml file was not recognized. When I added the same content to my mysite/lang/nl.yml file everything worked fine.
I created the translation in a template file (Includes/Navigation.ss)
<li><%t Navigation.BELGIUM "Belgium" %></li>
My nl.yml file looks as follows
nl: Navigation: BELGIUM: België
I am running the latest silverstripe version.
from silverstripe-framework.
@tractorcow thoughts on this? You recently did work on this stuff
from silverstripe-framework.
Yep, there's a bug in theme language files. I've updated the string detection code considerably, but it looks like localisation in the themes folder isn't working.
You might be better to move your strings to mysite/lang
for the time being until it's fixed.
from silverstripe-framework.
I'm not sure if that's still an issue in 3.x, but it was definitely a regression in 4.x - which I've fixed with #6628
from silverstripe-framework.
Related Issues (20)
- Session based GridField state management HOT 8
- SPIKE: Investigate ways to get configurable cache adapter prior to loading config HOT 3
- Make extension hook methods protected - part 2
- Migrate from m1/env to symfony/dotenv
- Refactor shortcode parsing HOT 2
- Move `ViewableData::Me()` out of `ViewableData` and into the template layer
- Better casting in `ViewableData`
- Default to session gridifield state manager in CMS 6
- text collector doesn't collect when parameters are passed as a variable HOT 3
- SearchableDropdownTrait::getSource doesn't respect lazy-loading HOT 5
- SQLSelect regression with subqueries HOT 6
- Deprecated getIterator function called in SSViewer_Scope HOT 2
- Permission check for 'Not strict check' is wrong AFAIK HOT 5
- Remember Me functionality fails when renewal is interrupted HOT 8
- SearchableDropdownTrait::saveInto calls DataObject::write HOT 4
- Sake script failure when PHP binary path contains spaces in SilverStripe 5.2.2 HOT 1
- Drop support for MySQL 5 in CMS 6
- `performReadonlyTransformation()` for `SearchableDropdownField` and `SearchableMultiDropdownField` doesn't respect lazy loading HOT 2
- DBForeignKey scaffolding uses wrong parameters to create SearchableDropdownField HOT 1
- HTMLValue setContent preg_replace stripping <header> tags HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from silverstripe-framework.