martimiz / silverstripe-languageprefix Goto Github PK
View Code? Open in Web Editor NEWSupport language prefix for multi-lingual websites using Translatable
License: Other
Support language prefix for multi-lingual websites using Translatable
License: Other
Is this module likely to receive an update to make it compatible with SS4?
I'm currently testing the prefixer but the homepage on the default langues is coming up as "Page not found." It works fine without the module. I'm using ss3.4 and here is my mysite/_config/config.yml
i18n :
common_locales:
en_CA:
name: 'English (Canada)'
native: 'English (Canada)'
en_AU:
name: 'English (Australia)'
native: 'English (Australia)'
Translatable:
enforce_global_unique_urls: false
---
Name: languageprefix-config
---
prefixconfig:
locale_prefix_map:
# 'en_GB': uk
'en_US': us
'en_CA': ca
enable_duplicate_urlsegments: true
disable_prefix_for_default_lang: true
Default locale is configured in _config.php as
i18n::set_locale('en_GB');
Translatable::set_default_locale('en_GB');
Any suggestions?
Hi,
first of all: nice job.
But how could be handled built-in controller/actions in multiple languages?
e.g.:
/Security/login
Hi,
when inserting a link to another page within my site with the HTML editor, I can choose the language in the popup helper window. But the wrong link is generated.
It will always point to my last langugage.
This might happen only when the last part of the url ist the same in all langugages for example:
/de/produkte/iphone5
/en/products/iphone5
/fr/produits/iphone5
No matter which language I choose, the generated link will always point to /fr/produits/iphone5
Environment: Silverstripe 3.1.2
Once this module is installed, how do you prevent the main translatable module from appending the locale (or -2) to the URL when using the same page name?
Is it possible to hide the main language prefix ?
For example, if the main language of my site is English, I would like url like http://www.mysite.com/about-us
(wihout the prefix) and for the translation into French: http://www.mysite.com/fr/ a-propos.
For now, I have two urls:
http://www.mysite.com/en/about-us
http://www.mysite.com/fr/a-propos
after installing module I have changed default lang to LT Translatable::set_default_locale('lt_LT');
made /?flush but still on homepage with or without /lt/ page not found.
After change the options on languageprefix.yml and do flush=all on homepage, when changing url segment of any page and press ok to update this value, the cms generate "-2" on end of name and never use the same url for differents languges
Silverstripe v: 3.6.2
php 7.0
This is not really an issue, but more like a question what's best.
Doesn't enable_duplicate_urlsegments: true in this module do the same as the following setting for Translatable?
Config::inst()->update('Translatable', 'enforce_global_unique_urls', false);
I'm using the second one now in a website and it works, or will something else break?
Could you please release tagged versions, so we can include them better in composer?
using "dev-master" just feels bad and is not safe to upgrade.
i made an action on my page_controller called "logout".
calling an url like "/logout/" or "/de/logout" results in a 404 beause PrefixModelAsController
a) handles all urls without prefix as 404 (maybe no bug but a feature)
b) doesn't check for actions on homepage.
"/de/home/logout/" works like a charm ;)
Hi, First of all, thanks for this very handy module. It has been a big help when making multilingual sites. Unfortunately, I have two sites that are showing a similar problem on the site sections that use non-Roman characters in the URL. One site is English/Vietnamese using SS 3.0.5 and compatible versions of Translatable and LanguagePrefix modules. The other site is English/Thai using SS 3.1 stable with current downloads from the master branch of Translatable and LanguagePrefix modules. This problem is a little hard to describe since this comment box keeps changing UTF8 characters into code, so please imagine that the portions of the URL suffixed with (in-thai) are actually Thai characters.
Links like this do not work:
http://asia.mysite.com/thailand/th/page-name(in-thai)
http://asia.mysite.com/thailand/th/our-technology(in-thai)/page-name(in-thai)
However, links like this do work:
http://asia.mysite.com/thailand/th/page-name-th
http://asia.mysite.com/thailand/th/our-technology-th/page-name(in-thai)
Am I missing something obvious here, or is this actually a bug?
Thanks, Seth
Getting this error:
Fatal error: Call to a member function getURLPrefix() on null in /var/www/html/languageprefix/code/LanguagePrefix.php on line 203
When trying to access /admin/settings
Firstly, great module.
I have just come across an issue when the CMS is in split view when editing pages. When attempting to edit any page other than the homepage (in the default language), the preview area doesn't use the language prefix and therefore ends up with a 404, which in turn switches the page in the left hand side of the CMS to the 404 page not found.
For example, with the stock contact us page, the URL Segment is indicated as:
_mydomain.com/en/contact-us_
That is available via the front end using ?stage=[Stage|Live] and all is fine, however the URL that the preview area tries to load is:
_mydomain.com/contact-us?stage=Stage_
which results in a 404.
If the CMS is set in "edit" mode with no preview to the right, everything is fine. So, in order to edit anything, the preview functionality can't be used.
I've only just figured out what was going on so haven't had a chance to go searching for a potential fix, but thought I'd raise the issue anyway.
When I added
URLSegmentFilter:
default_allow_multibyte: true
to .yml file, I got 404 error if visiting multibyte URL, like this - for example: www.mydomain.com/ru/заглавная-страница
Is it possible to set up the module to use the default locale when there is no language prefix?
For example, if I enter mysite.com/page/, and the default locale is en_US, it would display mysite.com/en_US/page.
Hope you understand what I need, since it's important for SEO.
Thanks,
Ivan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.