Commit Graph

89 Commits

Author SHA1 Message Date
Sean Harvey
7805e3e6d9 BUGFIX i18n::include_by_locale() assumes a themes directory always exists and causes error if that's not the case. Some projects don't require any themes, like pure applications. 2011-09-28 15:27:51 +13:00
Ingo Schommer
924f0feb5d BUGFIX Check for valid locale in i18n::set_locale()/set_default_locale()/include_locale_file()/include_by_locale() (as defined in i18n::$allowed_locales). Implicitly sanitizes the data for usage in controllers. (from r114469)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114473 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:03 +13:00
Ingo Schommer
5236e09026 BUGFIX Including template /lang folders in i18n::include_by_locale() (implementation started in r113919)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114208 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:20:02 +13:00
Ingo Schommer
20b41e1904 MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@113241 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:58 +13:00
Sean Harvey
f9257a6035 ENHANCEMENT New Member records are populated with the currently set default through i18n::set_locale()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@108499 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:43 +13:00
Ingo Schommer
fcd9858271 MINOR Better error handling in i18n::get_language_name()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107437 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:36 +13:00
Ingo Schommer
342d739504 MINOR Changed "no_NO" locale for Norwegian into the more commonly used "nb_NO" in i18n class, meaning translations from translate.silverstripe.com can actually be selected now (fixes #5746)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107394 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:35 +13:00
Sean Harvey
3be26a4cec ENHANCEMENT #5352 Decouple date display from i18n locales, users now have access to change their date and time formats in Member::getCMSFields() using Member_DatetimeOptionsetField field
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@107326 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:35 +13:00
Ingo Schommer
3aabb05d90 MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@105188 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:26 +13:00
Ingo Schommer
a0d4b58908 BUGFIX Fixed i18nTextCollector when used with i18nEntityProvider - class manifest is now stored lowercase, which means i18n::get_owner_module() didnt work reliably
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104995 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:25 +13:00
Mark Stephens
2eb9884ec9 BUGFIX: catch case of plugin not returning translations for the locale
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104847 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:24 +13:00
Mark Stephens
8e1f2b645c ENHANCEMENT: added plugins to i18n to support modules that provide custom translations.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@104827 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:24 +13:00
Ingo Schommer
c8a338dcab ENHANCEMENT Added i18n::set_default_locale() to set standard locale (which is different from "current locale" retrieved through i18n::get_locale())
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@103581 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:19:16 +13:00
Tom Rix
27f20c5948 ENHANCEMENT you can now choose your site locale at install time
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100769 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:52 +13:00
Luke Hudson
51de5dc914 BUGFIX: Fix mismatch with $all_locales and $common_locales (#5096)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100406 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:45 +13:00
Sam Minnee
f2266dae02 BUGFIX #4609: Fixed portoguese locales in common locales list.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90554 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-31 01:39:36 +00:00
Sam Minnee
e9ff3f3711 MINOR added en_GB to list of common locales (from r88073)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89179 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:22:16 +00:00
Ingo Schommer
f073fd9f5b BUGFIX Limiting i18n::include_by_locale() to scan directories only
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85310 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-27 03:09:34 +00:00
Sam Minnee
08844f66b0 BUGFIX: Performance imporvement to i18n::include_by_locale
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84166 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-11 09:10:09 +00:00
Sam Minnee
273ec1b240 ENHANCEMENT: Don't look for i18n lang files in hidden directories
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80236 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-28 01:16:56 +00:00
Ingo Schommer
ab42c551fb BUGFIX Using Translatable::set_default_lang() for the deprecated i18n::set_default_lang() - this should trigger lang->locale convertion, and fix issues with running a 2.2->2.3 database schema migration (see #4009)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76872 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-14 21:35:30 +00:00
Ingo Schommer
d0761a3e78 BUGFIX Fixed some wrongly duplicated locale values in i18n::$common_languages and i18n::$common_locales
BUGFIX Unified locale values between i18n::$all_locales and $common_locales - the common locales should be a subset of all locales, without any additional ones as this might cause side-effects with LanguageDropdownField (see #3958)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75782 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-30 22:56:56 +00:00
Ingo Schommer
f2efb12bdd MINOR Updated Translatable and i18n documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75707 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-30 02:51:17 +00:00
Ingo Schommer
3d0c4a1615 BUGFIX Fixed i18n::get_locale_from_lang() to return original parameter if it detects a fully qualified locale that shouldn't be converted
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75675 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 23:15:38 +00:00
Ingo Schommer
e482ada014 API CHANGE Deprecated Translatable::enable() and i18n::enable()- use Object::add_extension('SiteTree','Translatable'), Deprecated Translatable::disable() and i18n::disable() - use Object::remove_extension('SiteTree','Translatable'), Deprecated Translatable::enabled() - use $myPage->hasExtension('Translatable')
API CHANGE Removed Translatable::creating_from() - doesn't apply any longer
ENHANCEMENT Translatable extension is no longer hooked up to SiteTree by default, which should improve performance and memory usage for sites not using Translatable. Please use Object::add_extension('SiteTree','Translatable') in your _config.php instead. Adjusted several classes (Image, ErrorPage, RootURLController) to the new behaviour.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73951 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-01 16:35:32 +00:00
Ingo Schommer
c14b71dfc0 ENHANCEMENT Added Translatable::get_locale_from_lang(), Translatable::get_common_locales(), $common_locales and $likely_subtags in preparation to switch Translatable from using short "lang" codes to proper long locales
API CHANGE Deprecated Translatable::set_default_lang(), Translatable::default_lang()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73466 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-20 08:36:40 +00:00
Sam Minnee
189f0567f8 Merged from branches/2.2
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72811 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-10 22:17:26 +00:00
Sam Minnee
08a5a7c387 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72803 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-10 22:08:52 +00:00
Andrew O'Neil
635e2c3df6 Merged from 2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72453 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-04 03:44:11 +00:00
Ingo Schommer
7f4f57c307 ENHANCEMENT Added i18n::get_lang_from_locale() and i18n::convert_rfc1766()
ENHANCEMENT Using IETF/HTTP compatible "long" language code in SiteTree->MetaTags(). This means the default <meta type="content-language..."> value will be "en-US" instead of "en". The locale can be either set through the Translatable content language, or through i18n::set_locale()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@72367 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-02 22:13:30 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Ingo Schommer
e39f4f747a ENHANCEMENT Added welsh to i18n::$common_languages (#2640)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70317 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-18 21:30:10 +00:00
Ingo Schommer
58638c142e MINOR Changed visibility of i18n::get_owner_module() to public (used in CMSMenu class)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@70015 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-12 05:08:21 +00:00
Ingo Schommer
690f982a69 MINOR removed debug code from i18n
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69960 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:17:42 +00:00
Ingo Schommer
d3d6ae833d Merged, debugged and enhanced Translatable patches from branches/translatable at r64523, r64523, 64523, thanks wakeless!
API CHANGE Changed Translatable schema from auxilliary tables (SiteTree_lang, SiteTree_lang_Live) to automatically filtered records on the original table (SiteTree, SiteTree_Live), using $Lang and $OriginalID properties. Incompatible update to old schema, migration script is in the works.
API CHANGE Removed Translatable::get_one(), Translatable::write()
ENHANCEMENT Simplified Translatable tree generation by using getSiteTreeFor() in CMSMain->createtranslation()
ENHANCEMENT Added AllChildrenIncludingDeleted(), augmentNumChildrenCountQuery(),  augmentAllChildrenIncludingDeleted(), augmentStageChildren() to Translatable class to allow for more stable tree generation.
ENHANCEMENT Moved definition of Translatable schema from augmentDatabase() to Translatable->extraStatics()
ENHANCEMENT Changes to the CMS language selection refresh the whole admin interface instead of the tree only. This way we can add a URL parameter ?lang=<lang> to /admin, which makes the specific language bookmarkable and reloadable. Changes to LangSelector.js
ENHANCEMENT Added fallback to ModelAsController->getNestedController() to fetch page with matching URLSegment but different language in case no page is found in the current language.
ENHANCEMENT Added helper methods to Translatable: getTranslation(), hasTranslation(), isTranslation(), findOriginalIDs()
ENHANCEMENT Getters and setters for Translatable->getOriginalPage() etc.
ENHANCEMENT Hooking Translatable into ModelAsController and ContentController initialization in order to call choose_site_lang()
ENHANCEMENT Simplified Translatable->augmentSQL(), augmentWrite() by not using auxilliary tables
ENHANCEMENT Showing clickable links for Translations in Translatable->updateCMSFields()
BUGFIX Modifying Hierarchy/SiteTree Children getters to accept optional "context" which can be used to set a language explicitly through the $Lang property, rather than implicitly reyling on the static Translatable::current_lang()
BUGFIX Fixed TranslatableTest to work with new datamodel
BUGFIX Temporarily disabled cookie/session selection in Translatable::choose_site_lang() until we have a good test suite for the side effects.
MINOR Added "untranslated" CSS styles to tree nodes and marking them as inactive/grey


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69959 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 12:15:30 +00:00
Ingo Schommer
b7d394008e MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69957 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-10 11:35:50 +00:00
Ingo Schommer
085346f0e0 MINOR Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69704 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-01-05 06:19:48 +00:00
Sam Minnee
58dbe416ee Merged from branches/2.2
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65523 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-10 03:51:35 +00:00
Ingo Schommer
728e691a1a BUGFIX Added SSViwer support for i18n namespaces in templates with <% _t('MyNamespace.MyEntity', ... %>, to work around magically added namespaces from the parsed template file. Those auto-namespaces were logically not working in includes, as the parsing context is always the including template. Legacy support for auto-namespaces is still present due to its high usage.
ENHANCEMENT Added unit tests for i18n template parsing

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65361 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-06 02:50:14 +00:00
Ingo Schommer
c4cdc9ce87 ENHANCEMENT Made _t() global function in Core.php an alias for the new i18n::_t() method
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64493 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-17 15:40:59 +00:00
Sam Minnee
6fe79bc1c6 BUGFIX: Fix issue with language files not being included
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64471 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 23:39:19 +00:00
Ingo Schommer
5f70af6d38 ENHANCEMENT Moving i18n->textcollector() and related methods to new class i18nTextCollector and i18nTextCollectorTask - enabling running textcollector through CLI, refactored to instance methods for better testability
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64447 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 20:42:41 +00:00
Ingo Schommer
ec591fc1fe MINOR Documentation in i18n class
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64079 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-10 17:36:31 +00:00
Ingo Schommer
17ba4ded80 ENHANCEMENT Replaced hardcoded "en_US" references in i18n class with $default_locale
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64075 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-10 16:13:56 +00:00
Ingo Schommer
69dab4f551 MINOR Documentation
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63568 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 00:47:35 +00:00
Ingo Schommer
cb2919f56d ENHANCEMENT Added Maori to i18n::$common_languages
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60645 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-13 22:09:06 +00:00
Ingo Schommer
60860cc1b9 MINOR Unified @package PHPdoc (added where missing, removed duplicates)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56212 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-06-15 13:33:53 +00:00
Ingo Schommer
74cef69ae1 BUGFIX fixed php notice
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52178 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-06 03:31:11 +00:00
Sam Minnee
3d83f43eff Fixed i18n bug on safe mode
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51503 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-20 03:00:49 +00:00
Ingo Schommer
ed520fe9df fixed PHP notices
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@50831 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-11 00:39:44 +00:00