Commit Graph

15 Commits

Author SHA1 Message Date
Sam Minnee
3ee8f505b7 MINORE: Remove training whitespace.
The main benefit of this is so that authors who make use of
.editorconfig don't end up with whitespace changes in their PRs.

Spaces vs. tabs has been left alone, although that could do with a
tidy-up in SS4 after the switch to PSR-1/2.

The command used was this:

for match in '*.ss' '*.css' '*.scss' '*.html' '*.yml' '*.php' '*.js' '*.csv' '*.inc' '*.php5'; do
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" -exec sed -E -i '' 's/[[:space:]]+$//' {} \+
	find . -path ./thirdparty -not -prune -o -path ./admin/thirdparty -not -prune -o -type f -name "$match" | xargs perl -pi -e 's/ +$//'
done
2016-01-07 10:15:54 +13:00
Loz Calver
706877d72e FIX: Get locale from <html> element for i18n.js (fixes #4854) 2015-12-22 14:14:17 +00:00
colymba
8fb5e9c3a4 API New JS sprintf and inject replacement functions
Fix sprintf issues when replacement was at start of string + introduce
new inject function using injection map similar to the PHP version of
_t()
2014-06-05 22:47:49 +03:00
Andreas Harrenberg
64539a051b Update i18n.js
When looking for a translation, the fallback solution (CurrentLocale -> defaultLocale -> fallbackString) does not work for cms/javascript/CMSMain.Tree.js as localization for this part was changed to short locale names (e.g. de_DE -> de). (Don't know why...)

The original fallback solution will not find a translation for e.g. "Tree.ShowAsList" in the de-language file. For this entry there is also no fallbackString defined, so the menu in the CMS (right click on a page) is broken for each language that does not have the translation included.

I added another fallback level where the short version of the default language (en_US -> us) is searched before falling back to the fallbackstring and then finally giving up...
2013-12-01 17:48:59 +01:00
Ingo Schommer
2c145cd454 API JS i18n files with short locale names, generated by build task
The files are uploaded to transifex.com now, which means we needed
to consolidate the file names (= locales). Since Transifex doesn't allow
arbitrary JavaScript structures, we're using an intermediary JSON
format which gets transformed into the JS used by the framework.

See b59f3858af for generator logic.

Fixes https://github.com/silverstripe/silverstripe-framework/issues/2499
2013-10-25 12:05:46 +02:00
Simon Welsh
b0121b541c Add codesniffer that ensures indentation is with tabs. 2012-12-12 17:33:31 +13:00
Normann Lou
9aaa6b1a7b ENHANCEMENT: change those harded-coded 'sapphire' to 'framework' either in javascript code or inline document, or a <a> href propty. 2012-10-05 17:00:39 +13:00
Ingo Schommer
b135218789 BUG Detect JS lang by <body>, and force init 2012-08-06 10:59:18 +02: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
Ingo Schommer
07bca16af6 BUGFIX Fixed missing $H() reference in i18n.js (#2989)
ENHANCEMENT Added unit tests for i18n.js

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64878 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-29 13:20:38 +00:00
Ingo Schommer
ab8c7fbedc BUGFIX Consistent usage of ss.i18n.sprintf() instead of ss.i18n.printf() - the method is returning a string rather than outputting directly, so should be sprintf()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64081 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-10 21:06:59 +00:00
Ingo Schommer
54fa45c2fc BUGFIX Removed dependency of ss.i18n.js on other libraries by replacing $$ with document.getElementsByTagName() and implementing a custom event attacher - see #2927
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64010 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-09 17:58:56 +00:00
Ingo Schommer
9d31e43de3 BUGFIX Properly merging different dictionaries for javascript i18n implementation (see #2916)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63857 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-08 12:17:00 +00:00
Ingo Schommer
7c0b69ea34 ENHANCEMENT Added javascript i18n support through Requirements::process_i18n_javascript() and ss.i18n javascript lib
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63566 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-03 00:46:07 +00:00
Ingo Schommer
393caf4287 FEATURE made sapphire i18n-capable
FEATURE a little bit of german translation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@43842 467b73ca-7a2a-4603-9d3b-597d59a354a9
2007-10-25 02:47:45 +00:00