Commit Graph

80 Commits

Author SHA1 Message Date
Robbie Averill
f761674834 Merge branch '2.3' into 2.4 2019-07-23 15:38:42 +02:00
Micah Sheets
62523e23df Update Translatable.php 2017-08-15 10:06:38 +12:00
Conrad
07bd3c58cb Fixes #239, cacheKeyComponent updates cache key when filtering is disabled 2016-04-04 15:10:24 +12:00
UndefinedOffset
58156353d9 BUGFIX: Fixed issue #213 causing crash when accessing a translation with a checkbox 2015-12-02 10:04:22 -04:00
Daniel Hensby
59a9d4d06e Merge remote-tracking branch 2.0 into 2.1
Conflicts:
	.travis.yml
	README.md
	composer.json
2015-11-03 21:44:46 +00:00
Ingo Schommer
a0a6ec2f91 Consistently use uppercase "Locale" GET param
Causes inconsistent behaviour between form field name ("Locale")
and view state in GET parameters ("Locale" and "locale").

Related to #156.
2015-06-01 20:54:04 +12:00
Damian Mooyman
6aefb2e09f BUG Fix compat with userforms/translatable 2015-05-29 15:52:14 +12:00
Ingo Schommer
05b4b84f19 Fixed 3.x deprecations, updated dep from 3.1 to 3.2 2015-04-29 18:56:06 +12:00
Damian Mooyman
c0d302eb8e Improve dev/build with obsolete class names 2015-02-24 11:17:03 +13:00
Ingo Schommer
986beafa44 Compatibility with 3.2
3.2 still uses SQLQuery rather than SQLSelect,
but changes the getWhere() return signature.
2015-02-23 18:51:59 +13:00
Dirk Adler
1b196d8a83 fixes URLSegment validation for non nested urls 2014-11-19 17:02:18 +13:00
Florian Thoma
5deae7a8f9 BUGFIX support for dropdowns of has_one relations 2014-05-21 14:39:07 +10:00
Ingo Schommer
522dff2487 Merge pull request #152 from mateusz/return-list-bug
BUG Satisfy the API contract - always return SS_List instance.
2013-10-16 12:17:32 -07:00
Mateusz Uzdowski
8cdeb8005e BUG Satisfy the API contract - always return SS_List instance.
Currently returning null in some situations.
2013-10-16 16:45:31 +13:00
Gus King
8f922beff3 Added check to see if the DataObject actually has translation before iterating over. 2013-10-14 19:39:29 +13:00
Hamish Friedlander
3acb8b9fba FIX 63366327 breaking "Existing Translations" links
CMSEditLink() was changed to always add a locale, but the link
creation for "Existing Translations" in Translatable#updateCMSFields
assumed there was no query string on the end of CMSEditLink()s return
value

Note that youll still end up with duplicate locale parameters after
this patch, but it will work as PHP always takes the last parameter
for preference. A seperate patch for Controller::join_links will
fix the duplicate parameters
2013-09-20 11:21:28 +12:00
Ingo Schommer
15e9037c1b Only suffix unique URLSegment if enforce_global_unique_urls=true (#138) 2013-09-05 15:55:45 +02:00
Ingo Schommer
69adec9455 Merge pull request #132 from jthomerson/pulls/only_write_translations_when_class_actually_changed
Only write translations when class actually changed
2013-09-05 05:02:50 -07:00
Ingo Schommer
b24316167a Merge pull request #133 from Ekman/master
Links in head will now include translated versions of each page including itself
2013-08-20 12:44:20 -07:00
Niklas Ekman
fa850239f4 Fixed tabs 2013-08-20 21:35:39 +02:00
Niklas Ekman
6f38a21640 Fixed tabs 2013-08-20 21:05:11 +02:00
Niklas Ekman
a66de759bb SilverStripe coding convetions 2013-08-19 10:00:08 +02:00
Niklas Ekman
03722d2a8e MetaTags now includes translated versions of itself including the default translation 2013-08-18 18:41:08 +02:00
Jeremy Thomerson
9e37602ef7 Make publishing default locale node faster
When you publish a node in the default locale it calls forceChange to make
every field behave as if it has changed. The problem in Translatable is then
it would think that you actually changed the class of the default locale node
and it would force a change on every translation. This was unnecessary when you
have not actually changed the class name. If you have a great deal of
translations this was causing a significant lag when you publish anything in
the default locale.
2013-08-18 02:32:07 +00:00
Ingo Schommer
b898134b11 NEW Translatable.enforce_global_unique_urls config setting
See https://github.com/silverstripe/silverstripe-cms/pull/216
and https://github.com/silverstripe/silverstripe-cms/pull/772
for context
2013-08-03 13:01:39 +02:00
Jeremy Thomerson
a008f928c6 FIX: get_one_by_locale didn't work when filter disabled 2013-08-03 12:43:46 +02:00
Ingo Schommer
69fe99735b Merge pull request #128 from jthomerson/pulls/enhance_disabling_locale_filter
ENHANCEMENT: better pattern for dis-/enabling locale filter
2013-08-03 03:17:38 -07:00
Jeremy Thomerson
080b9e45ea ENHANCEMENT: better pattern for dis-/enabling locale filter 2013-07-31 15:37:30 +00:00
Jeremy Thomerson
2da48dfd65 FIX: don't re-enable the locale filter if it wasn't enabled before
This breaks code that tries to get all instances of SiteConfig like:

```
Translatable::disable_locale_filter();
$all = SiteConfig::get();
Translatable::enable_locale_filter();
```

What was happening was that our populateSiteConfigDefaults method was
getting called before the actual data list the users uses above is
created, so it was re-enabling the locale filter before the
augmentDataQuery function was called on the data list created for the
user. Thus, they'd get a locale-augmented query and only get the
SiteConfig for the current locale, and not all as clearly intended.
2013-07-24 21:25:42 +00:00
Ingo Schommer
34a171b9dc Fixed coding conventions 2013-07-15 12:12:09 +02:00
Jeremy Thomerson
9771d97e1f ENHANCEMENT: significant speed improvement for many locales
Iterating over an array of locales and querying for each one causes tons
of unnecessary queries. This is especially evident when you get up to
hundreds of translations of a page. It makes the CMS admin UI insufferably
slow.  This is a little tweak to query for all of them at once instead of
individually.
2013-07-14 21:08:53 +00:00
Ingo Schommer
c551915745 Merge remote-tracking branch 'origin/1.0' 2013-06-28 10:12:58 +02:00
Jeremy Thomerson
f4e5137392 FIX: make getTranslations work even when translation classes differ
Even though it is an edge-case, some sites may allow translation groups to be
composed of different classes.  In that case, Translatable->getTranslations()
should still work.

Also, this commit adds a helper function for testing two array for equality
where you don't care about the order of the elements.  This cleaned up a lot
of copy and paste boilerplate code that was sorting arrays to test.
2013-06-06 02:59:51 +00:00
Ingo Schommer
51cd0146df Merge branch '1.0'
Conflicts:
	.travis.yml
	code/model/Translatable.php
2013-06-03 12:06:29 +02:00
Jeremy Thomerson
cde0f57c43 FIX support disabled locale filter for delayed querying
Fixes silverstripe/silverstripe-translatable#113
2013-06-01 14:14:54 +00:00
Jeremy Thomerson
929beb216c FIX can not access private static variables of i18n 2013-05-31 19:09:03 +00:00
Ingo Schommer
f7eee8596d Merge pull request #109 from tractorcow/3.1-api-updaterelativelink
API Hook into SiteTreeExtension::updateRelativeLink
2013-05-17 05:04:12 -07:00
Sean Harvey
4c6e41441a Fixing @package declaration to translatable instead of sapphire 2013-05-17 11:09:52 +12:00
Damian Mooyman
ea4645af24 API Hook into SiteTreeExtension::updateRelativeLink 2013-05-10 12:23:36 +12:00
g4b0
0dc7b41539 BUG: added VIEW_LANGS permission in Translatable::providePermissions() 2013-04-12 09:30:57 +02:00
Ingo Schommer
e2c1a7111e Merge branch '1.0'
Conflicts:
	.travis.yml
	composer.json
2013-04-07 14:26:00 +02:00
Steffen Maaß
9579748e13 FIX: getTranslations should not change the locale-filter-state
If the locale-filter was disabled before calling the method, it would be
enabled after calling getTranslations, this commit now only re-enabled
the locale-filter if it was enabled before calling the method...
2013-04-07 14:23:38 +02:00
cam-findlay
232c187850 merged $allCodes returns items with nested array
items from the common_locales in line 1493 return nested array of "name"=>LangName,"native"=>NativeName.
need to make sure to pull the "name" parameter from the array for the $returnMap.
Otherwise was returning:

[Notice] Undefined offset: 0
2013-03-28 15:26:42 +01:00
Ingo Schommer
5c7682013c Misc 3.1 compat changes
Removed nested_urls check, its the only supported mode now
2013-03-26 13:55:21 +01:00
Ingo Schommer
a3ff187938 Using Config API to retrieve core values (fixes #103)
Required for 3.1 compat
2013-03-26 00:49:58 +01:00
Ingo Schommer
20c2e9a190 Fixed add_extension() and add_to_class() usage 2013-03-19 09:59:08 +01:00
Simon Elvery
68188a3ae8 FIX Retrieve list of translatable fields not database fields 2013-03-06 11:46:20 +10:00
Simon Elvery
6460c089ca NEW Better transformation of form fields (specifically CheckboxField) 2013-02-28 00:53:28 +01:00
Simon Elvery
53a7b6a633 BUG Make original field label translatable 2013-02-28 00:52:52 +01:00
Ingo Schommer
17195d4e86 3.0 compatibibility (Object::has_extension)
SiteTree::has_extension() is only available in 3.1,
split off 3.0 compat branch to avoid deprecation warnings.

See https://github.com/silverstripe/silverstripe-translatable/issues/98#issuecomment-14020318
2013-02-27 10:48:57 +01:00