Comments (8)
Ok - can't look at it right away but will try this weekend
from silverstripe-languageprefix.
Hmm that shouldn't happen. Can you tell me which versions of CMS, Translatable and LanguagePrefix you are using?
from silverstripe-languageprefix.
Language Prefix 2.0
Translatable 2.2
CMS 3.5.0
prefixconfig:
locale_prefix_map:
'en_US': us
'en_GB': uk
'es_ES': es
'en_ZA': za
'en_AU': au
enable_duplicate_urlsegments: true
disable_prefix_for_default_lang: false
from silverstripe-languageprefix.
OK, just had a look anyway, but I couldn't reproduce it:
silverstripe 3.5.0
translatable 2.2.3
languageprefix tagged versions v2.0.0 Γ‘nd v3.0.0 (preferred)
mysql 5.6.35
php 5.6.30
I did: default site en_US
Went to settings, created translation en_UK.
Then back to pages, created translation en_UK for home.
Jumped back and forth, no issues...
from silverstripe-languageprefix.
My default translation in en_GB incase that matters?
Could be something in my database or site config extension?
`class CustomConfig extends DataExtension {
private static $db = array(
'FormattedSiteName' => 'HTMLText',
'Contact_Email' => 'Varchar(250)',
'CdnUrl' => 'Varchar(250)',
'TwitterID' => 'Varchar(250)',
'FacebookLink' => 'Varchar(250)',
'YoutubeID' => 'Varchar(250)',
'InstagramID' => 'Varchar(250)',
'InstagramAccountNumber' => 'Varchar(250)',
'InstagramAccessToken' => 'Varchar(250)',
'SpotifyID' => 'Varchar(250)',
'FooterSocial' => 'Varchar(250)',
'EmailNotification' => 'Varchar(100)',
'LicensingLink' => 'Varchar(100)',
'FooterText' => 'HTMLText',
'CopyrightLine' => 'Varchar(250)',
'AutoTranslateContent' => 'Boolean',
'TimeZoneOffsetType' => 'Enum("Disabled,Ahead,Behind","Disabled")',
'TimeZoneOffsetValue' => 'Varchar(10)'
);
private static $has_one = array(
'SiteLogo' => 'Image',
'FooterLogo' => 'Image'
);
public function updateCMSFields(FieldList $fields) {
$fields->addFieldToTab("Root.Main", new TextField("FormattedSiteName", "Site name with formatting (wrap alternate words with <span> tags)"));
$fields->addFieldToTab("Root.Main", new TextField("Contact_Email", "Contact Email"));
$fields->addFieldToTab("Root.Main", new TextField("EmailNotification", "Email for comment notifications"));
$fields->addFieldToTab("Root.Main", new TextField("LicensingLink", "Link for licensing enquiries"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("TwitterID", "Twitter ID"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("FacebookLink", "Facebook Link"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("YoutubeID", "Youtube ID"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("InstagramID", "Instagram ID"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("InstagramAccountNumber", "Instagram Account Number (this is not the same as user id)"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("InstagramAccessToken", "Instagram Access Token (this must be generated from Instagram API)"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("SpotifyID", "Spotify ID"));
$fields->addFieldToTab("Root.SocialMedia", new TextField("FooterSocial", "Footer Social Label"));
$fields->addFieldToTab("Root.Main", new TextField("CdnUrl", "Content Delivery Network URL"));
$fields->addFieldToTab('Root.Main', new DropdownField(
'TimeZoneOffsetType',
'Time Zone Relative to UTC',
singleton('SiteConfig')->dbObject('TimeZoneOffsetType')->enumValues()
));
$fields->addFieldToTab("Root.Main", new TextField("TimeZoneOffsetValue", "Time Zone Offset from UTC in HH:MM format (e.g. 8:30)"));
$fields->addFieldToTab("Root.Main", new TextField("CopyrightLine", "Site Copyright Line (Do not include ©)"));
$fields->addFieldToTab("Root.Main", new HTMLEditorField("FooterText", "Links to terms, conditions, privacy policy and other legal documents."));
$fields->addFieldToTab("Root.Main", new CheckboxField("AutoTranslateContent", "Automatically translate content via Google Translate"));
$fields->addFieldToTab('Root.Main', $siteLogoUploadField = new UploadField('SiteLogo','Site Logo'));
$fields->addFieldToTab('Root.Main', $footerLogoUploadField = new UploadField('FooterLogo','Footer Logo'));
$config = SiteConfig::get()->filter('Locale', Translatable::get_current_locale())->first();
$siteLogoUploadField->setFolderName('themes/' . $config->Theme . '/' . str_replace('_', '-', Translatable::get_current_locale()) . '/');
$siteLogoUploadField->getValidator()->setAllowedExtensions(array('jpg', 'png', 'jpeg', 'gif'));
$footerLogoUploadField->setFolderName('themes/' . $config->Theme . '/' . str_replace('_', '-', Translatable::get_current_locale()) . '/');
$footerLogoUploadField->getValidator()->setAllowedExtensions(array('jpg', 'png', 'jpeg', 'gif'));
}
}`
from silverstripe-languageprefix.
Did you possibly add LanguagePrefix as an extension to SiteConfig? Because that would give that error, and you shouldn't have to do that anyway...
from silverstripe-languageprefix.
Yes, looks like I have:
SiteConfig: extensions: - LanguagePrefix - CustomConfig
I will try removing that. Wonder why I did it... :)
from silverstripe-languageprefix.
Yep - you got it! Removed that and things seem to be working. I guess it's possible that crept in there by mistake during a merge conflict or something.
Many thanks for you help!
from silverstripe-languageprefix.
Related Issues (17)
- Inserting Link with HTML Editor HOT 3
- after change Translatable::set_default_locale from EN to LT home page not found HOT 3
- 404 error if multibyte URL's are allowed. HOT 8
- How to hide the main language prefix HOT 1
- Prevent Translatable appending locale to a URL HOT 1
- release tagged versions HOT 6
- 404 on Homepage HOT 4
- enable_duplicate_urlsegments HOT 1
- SS4 Compatible Version HOT 1
- Silverstripe 4 Namespacing & Compatibility HOT 5
- cannot call action on homepage HOT 1
- Language prefix not used in CMS split view HOT 19
- URLSegment same on various languages -> another solution? HOT 5
- Use default locale without language prefix HOT 42
- Multi-byte character strings immediately after language prefix cause a 404 HOT 3
- How to handle SS- built-in routes/controllers 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-languageprefix.