Commit Graph

61 Commits

Author SHA1 Message Date
Jeremy Bridson
cf75166d83 MINOR: ISSUE-19 CWP Accessibility fixes - Added macron to Māori toggle button for translations on the CWP demo site. 2013-08-12 15:39:00 +12:00
Ingo Schommer
c78c0aa828 Fixed merge error
See 00ffe72944
2013-08-07 17:33:06 +02:00
Ingo Schommer
afe06661ef Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/templates/Includes/LeftAndMain_Menu.ss
	admin/templates/Includes/ModelAdmin_ImportSpec.ss
	admin/templates/Includes/ModelAdmin_Tools.ss
	admin/templates/LeftAndMain.ss
	admin/templates/ModelSidebar.ss
	i18n/i18n.php
	templates/ComplexTableField.ss
	templates/ComplexTableField_popup.ss
	templates/FileIFrameField_iframe.ss
	templates/Includes/GridFieldItemEditView.ss
	templates/Includes/TableListField_PageControls.ss
	templates/RelationComplexTableField.ss
	templates/TableField.ss
	templates/TableListField.ss
2013-08-07 17:14:47 +02:00
Ingo Schommer
00ffe72944 Translations: Switch to Transifex format
- Based on new (last) translation download from getlocalization.com
- Removed untranslated strings. Getlocalization started including those at some point
which is highly annoying, unnecessary and breaks the new transfix system,
since it'll mark all of the english strings as actual translations
- Avoid dots in entities. It confuses the Transifex YML parser
- Removed some locales unknown to Transifex which didn't have any translations anyway
- Removed "lolcat" locale, uses custom notation (en@lolcal)
  which SilverStripe's i18n system can't handle
  (needs mapping from SS naming to Zend naming)
- Renamed "Te Reo/Maori" locale from "mi_NZ" to "mi" (Transifex/CLDR notation)
- Namespaced all entities used in templates (deprecated usage)
- Converted dots to underscores where template filenames are used for namespaces,
since Transifex YML parsing handles them as separate YML keys otherwise
- Removed whitespace in entity names, SilverStripe i18n can't handle it
- Only allow selection of locales registered through i18n::$all_locales to avoid
  issues with unknown locales in Zend's CLDR database
2013-08-07 00:25:16 +02:00
Hamish Friedlander
efea4dbe94 NEW Allow specifying priority for translations
Priority for translations was hardcoded, and hardcoded the project name as "mysite".

This takes the order from a configuration property "module_prority". You can
use standard config fragment before and after rules to make a module less or
more important than anything else, with these tweaks:

 - Unless it has it's order explicitly defined, the "project" module (normally mysite)
   will be considered highest priority

 - There is an "other_modules" value in the order list which will be replaced by
   all the modules (except the project module) that don't have their order
   explicitly defined.
2013-05-06 12:51:46 +12:00
Ingo Schommer
469eaee4c1 Fixed i18n.common_locales definitions 2013-03-28 09:04:36 +01:00
Ingo Schommer
e97c034922 API i18n::$common_languages and i18n::$common_locales converted to Config API
They are now accessed via the Config API, and contain associative rather than indexed arrays.
Before: `array('de_DE' => array('German', 'Deutsch'))`, after: `array('de_DE' => array('name' => 'German', 'native' => 'Deutsch'))`.

Also fixed a i18n.js_i18n config accessor
2013-03-27 20:42:46 +01:00
Ingo Schommer
880702fc74 Fixed static config access in Currency and i18n (fixes #8341) 2013-03-26 10:13:51 +01:00
Ingo Schommer
3334eafcb1 API Marked statics private, use Config API instead (#8317)
See "Static configuration properties are now immutable, you must use Config API." in the 3.1 change log for details.
2013-03-24 17:20:53 +01:00
Ingo Schommer
c11b3918fc Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/css/screen.css
	admin/scss/_style.scss
	core/PaginatedList.php
	email/Mailer.php
2013-01-21 11:14:57 +01:00
Ingo Schommer
317495f8ef Merge pull request #1035 from zoao/3.0
tinymce language portuguese is not working
2013-01-11 07:11:54 -08:00
Ingo Schommer
e66408b0a7 Merge pull request #1044 from uniun/3.0
BUG Hardcoded project name in include_by_locale()
2013-01-11 06:46:20 -08:00
Ingo Schommer
8ec3641e60 Merge remote-tracking branch 'origin/3.0' into 3.1
Conflicts:
	admin/javascript/LeftAndMain.FieldHelp.js
	lang/en.yml
	model/URLSegmentFilter.php
2012-12-21 15:04:17 +01:00
Ingo Schommer
f0f83b26a8 BUG Graceful handling of sprintf with too few params in i18n::_t()
Originally discovered as a problem with the 'GridFieldDetailForm.Saved' in nl.yml
2012-12-21 11:46:39 +01:00
uniun
55b611d99d BUG Hardcoded project name in include_by_locale()
include_by_locale() should not use hardcoded default project name 'mysite' (fixes #7969).
2012-12-14 18:20:18 +02:00
João Martins
bdc17198e8 tinymce language portuguese is not working 2012-12-14 00:47:32 +00:00
Ingo Schommer
c55c7c33f8 Merge branch '3.0'
Conflicts:
	admin/code/CMSProfileController.php
	composer.json
	tests/model/DataObjectTest.php
2012-11-22 23:51:28 +01:00
Sean Harvey
f41650c64f Remove deprecated i18n::include_locale_file()
Use Zend_Translate instead.
2012-11-15 14:43:16 +13:00
Ingo Schommer
06ad5f5c69 Added Simplifie Chinese to i18n::$common_locales
See https://github.com/silverstripe/silverstripe-translatable/issues/66
2012-11-09 10:13:01 +01:00
Sam Minnee
1f7fc1f76a FIX Remove instances of lines longer than 120c
The entire framework repo (with the exception of system-generated files) has been amended to respect the 120c line-length limit.  This is in preparation for the enforcement of this rule with PHP_CodeSniffer.
2012-09-30 17:18:13 +13:00
Ingo Schommer
e2f073f38a Method visibility according to coding conventions 2012-09-20 10:46:59 +02:00
Ingo Schommer
ec89832b93 Registering Te Reo support in i18n 2012-08-13 00:15:36 +02:00
Ingo Schommer
395580bdd6 BUG Locale-isolated i18n/Zend cache
In certain cases (e.g. with the mi_NZ locale),
the i18n system would regard a langage as already
loaded if it was restored from a cached, but empty
translation list (through Zend_Translate).
This was due to the cache key being generated
based solely on the content, rather than taking
other options like the locale into account.
2012-08-12 22:11:55 +02:00
Ingo Schommer
2bd9852ae9 Fixed spelling of "Maori" in lang selection 2012-07-16 11:21:05 +02:00
Ingo Schommer
712f28bc78 Scoped deprecation messages (fixes #7645) 2012-07-13 11:37:35 +02:00
Ingo Schommer
acfc658b4e BUGFIX Fail silently in _t() legacy mode when using sprintf(), to avoid outdated translations breaking with a fatal error (e.g. CMSMain.ACCESS changed from two to one usage of {title}, which isn't changed yet in most languages). Slight performance overhead, but acceptable since its legacy usage only 2012-06-04 11:40:55 +02:00
Sam Minnee
db79739023 BUGFIX: Fixed inconsistencies in en vs. en_US handling in i18n 2012-05-28 14:10:58 +12:00
Sean Harvey
77dbceee35 BUGFIX i18n::include_by_locale() doesn't include a fallback language, _t() instead will include the language if it's not available.
This fixes en_GB translations not being picked up. i18n::get_translators() will always have a fallback of "en" language without the
region, and "en_US" as the locale.
2012-05-23 11:48:37 +12:00
Ingo Schommer
431b9589b6 BUGFIX Fixed arguments in global _t() function, added check for $returnValue fallback that its not the injection array as second parameter 2012-05-01 22:17:01 +02:00
Ingo Schommer
e949b6f2b0 ENHANCEMENT Backwards compatible $priority parameter for i18n::_t(): Allow numeric arrays as parameters, as well as %s style replacements with a named parameter map (easier transition to new system with existing translation strings) 2012-05-01 22:17:00 +02:00
Ingo Schommer
98c2517b80 MINOR Fixed i18n:;get_owner_module(), broken by changed manifest returns (paths with leading slash) 2012-04-27 10:11:06 +02:00
Andrew O'Neil
a37370343e BUGFIX: Fix ?flush=1 not flushing en_US language 2012-04-23 14:51:12 +12:00
Ingo Schommer
a44916dc19 API CHANGE Don't use $tinymce_lang lookup in i18n::get_lang_from_locale(), as it mixes locales with langs and hence breaks language fallbacks in _t() (e.g. "pt_BR" returns "pt_br", rather than "pt") 2012-04-18 13:20:23 +02:00
Ingo Schommer
c2797f3ffa Merge pull request #342 from silverstripe-big-o/sapphire
---

This is the new _t syntax. All i18n unit tests pass.
2012-04-18 10:16:23 +02:00
Julian Seidenberg
7710cf59c7 MINOR: updating the documentation 2012-04-18 18:14:03 +12:00
Julian Seidenberg
0da62b9552 BUGFIX: fixing i18n _t function breaking out of when correct translation found 2012-04-18 17:35:32 +12:00
Julian Seidenberg
65e3651ff4 API-CHANGE: new translatable syntax _t function 2012-04-18 17:35:31 +12:00
Sam Minnee
5e5c5defa2 BUGFIX: Fixed inconsistency in common_languages reference to Portuguese (#4911) 2012-04-18 11:00:38 +12:00
Ingo Schommer
6e13512200 MINOR Fixed up some language mappings in i18n (slightly different locales exported from getlocalization.com) 2012-04-15 20:54:24 +02:00
Ingo Schommer
d3b63dae0c MINOR Allowing to flush translation cache through ?flush=1 2012-04-15 18:46:04 +02:00
Ingo Schommer
d57e864110 MINOR Fixed tests related to i18nLegacyAdapter changes 2012-04-15 18:46:02 +02:00
Ingo Schommer
fca2c205b7 API CHANGE Removed $priority arguments from _t(), use module priorities instead.
ENHANCEMENT Refactored i18nTextCollector collection logic alongside $priority removal, from regex to (slightly more maintainable) PHP tokenizer. Using var_export() for generating PHP, which auto-escapes strings more robustly.
ENHANCEMENT Refactored i18nTextCollector into pluggable writers (in preparation of new YML output format)
2012-04-15 17:17:17 +02:00
Ingo Schommer
d44f6b3e1f MINOR Removed deprecated usage of $priority argument in _t() calls 2012-04-15 17:17:17 +02:00
Ingo Schommer
3002598a5e MINOR Hardcoding correct module priorities in i18n.php 2012-04-15 17:17:16 +02:00
Ingo Schommer
95cdbe9d2c MINOR Avoid duplicate var declaration in i18n::_t() 2012-04-15 17:17:16 +02:00
Ingo Schommer
27ec83ce40 MINOR i18n::_t() getter performance optimisation (saves 10% on default CMS execution!) 2012-04-15 17:17:16 +02:00
Ingo Schommer
03de6e5e5f MINOR Removed i18nSSLegacyTranslator from default setup for performance reasons, document how to re-apply it 2012-04-15 17:17:16 +02:00
Ingo Schommer
652f0ec007 MINOR Infinite cache 2012-04-15 17:17:16 +02:00
Ingo Schommer
796975f53b MINOR Don't set locale on adapter in i18n::_t() for performance reasons, we're passing it with each individual translate() call anyway 2012-04-15 17:17:16 +02:00
Ingo Schommer
190c758639 MINOR Reverting to use directory scanning rather than Zend_Translate() in i18n::get_existing_languages(), as the only way to determine this information from Zend is loading all locales (which is way too slow e.g. for loading a language drop down in the member profile) 2012-04-15 17:17:15 +02:00