Questions tagged [localization]

Locales and multi-lingual translations.

Filter by
Sorted by
Tagged with
2
votes
1answer
349 views

How do I convert a date stored in UTC to the user's current locale in PHP?

I have a date stored in the database in UTC. 2016-01-13 09:01:16 I can query the database and output this date just fine. But it outputs in the date in the wrong timezone. How do I adjust a date ...
1
vote
2answers
368 views

Locales - New locales not copying assets across

I have a site made in English and need to add another locale that will be almost identical to the original site. However while adding new locales everything bar the asset entries are being copied. ...
2
votes
1answer
88 views

How can I get Sprout Forms errors in current language using AJAX?

I'm using a form using Sprout Forms plugin. This form is set for submitting via AJAX. The documentation explains how to translate error message, but this is not working via AJAX submissions. ...
1
vote
1answer
299 views

Translating a section's title field on save

For a Single section's entry type that has the title field hidden, I'd like to translate the generated title, as per the entry's locale. I've currently got the following in the entry type's "Title ...
2
votes
1answer
134 views

siteUrl in Twig templates not working

I've got a problem where siteURL wasn't working for a localized version of my site. I have a site in two languages — Russian and English, with Russian exposed under www.mysite.com and English under ...
1
vote
1answer
81 views

How to set multi-lingual image paths in a css file for different environments?

Not sure how to do this. I'm setting up a multi-lingual site with a couple of locales and I have 3 different environments set up. I've set up some environmentVariables for assets store and assets path ...
1
vote
1answer
81 views

Is it possible to have multiple locales that use different domains instead of subfolders?

Instead of: example.com/en example.com/de I'd have: example.com example.de Can I do this with craft? I see this has been discussed, but a complete solution hasn't been posted.
3
votes
2answers
363 views

Using user-selectable timezones to show localized post dates

In my user profiles, I have a text field where the user's timezone is set, in the standard America/New_York format. Craft's timezone is set to New York, and the server's timezone is set to UTC. I'm ...
2
votes
1answer
81 views

Craft not generating language links correctly

{{siteUrl}}, {{category.url}}, {{product.url}}, etc. is not outputting any language. The main language is Norwegian. I created a folder for English (/en/) with define('CRAFT_LOCALE', 'en_us'); ...
1
vote
1answer
266 views

Matrix Fields translation not working

I have the following problem: My Craft site was setted up normally. I made entries with matrix structure and build one after another. Then after i built a lot of entries i wanted to set up a second ...
1
vote
1answer
21 views

Assigned Files in entries won't get synced on localization

I've got an entry-type, which has images and sound-files assigned through an asset-field. When i create an entry, those fields won't be synced in my other languages, even though the mark for "This ...
1
vote
1answer
488 views

Session cookies

I'm in the process of adding a second site to a Craft installation using custom locales. The two sites will be accessed on different sub-domains, e.g. site1.domain.com and site2.domain.com. I need to ...
1
vote
0answers
73 views

Why does getUrl fail when using transforms on a translatable asset?

I have a project with the following code: {% if entry.filmPoster | length %} <img src="{{ entry.filmPoster.first().getUrl('filmPoster') }}" alt=""> {% elseif entry.locale('en_gb')....
2
votes
1answer
44 views

Translated pages load a white empty page on localised site

I'm running Craft CMS 2.6.2949 on PHP 7.0.10. I have set up 3 locales: nl_be, en and fr. I have set the following config into general.php '.dev' => array( // ... 'siteUrl' => ...
2
votes
1answer
258 views

Control panel field name & instructions translations

I've installed a Craft Pro site with 3 locales: Dutch, French & English, but the people who are going to input data will speak those languages too, so I need to translate the instructions field in ...
0
votes
0answers
81 views

Locale migration …

Any thoughts on the best way (if at all) of bulk-migrating content within a site from one locale to another? We have a large(ish) site and want to streamline into a single locale. This means moving a ...
1
vote
1answer
547 views

Redirect and locale issues when using Valet / Caddy Server

I'm trying to setup our Craft CMS dev environment with Valet which is just a wrapper for Caddy Server and dnsmasq. I seem to be running into some redirect/locale issues that's preventing these pages ...
1
vote
0answers
33 views

Is it possible to create a custom field listing all enabled locales?

We have a multilingual site with about 30 different locales and about 5 pages of content for each. We're using Craft as a content API for the editors to manage content. Some of those locales share ...
2
votes
1answer
247 views

Correct timezone for AttributeType::DateTime in CP

I've written a plugin that stores records in it's own table. I can see that the dateCreated and dateUpdated fields are stored in UTC. When I want to display them in a CP template, I'm using ...
1
vote
3answers
421 views

Modify Craft locale inside Element API plugin?

I’m using the Element API plugin to retrieve my entries as JSON. It is available under the /api route. For getting entries in a different locale I pass a locale query param and use it inside the ...
1
vote
0answers
36 views

What is the best way to make text that has html translatable?

I have a block of text I'd like to make translatable. Within that block of text there is a link. The following works: {{ "Lorem ipsum. <a href='{url}' target='_blank'>Aenean commodo ligula</...
3
votes
1answer
826 views

Is it possible to use set the locale manually in a template?

I've got a generic newsletter template. Now some of our newsletters are in Spanish. It's overkill and more complicated for the admins to bother with settings up different locales, so instead I'd like ...
0
votes
1answer
119 views

Use en-US instead of en_us locale code

I want to use locales like en-US instead of en_us. Is there a way to do this other than creating totally new locales? Can I set it up at the siteUrl ?
4
votes
1answer
87 views

Override admin local name

I changed the language locale to Hungarian, but the translation for the singles looks a bit funny. Is there an easy way to override it with my version? Singles are translated to "Egyedülállók" but ...
2
votes
1answer
297 views

Selecting entries using a checkbox field

I had what I thought was a very simple issue: Select some categories on the front-end, filtering by a Checkbox field. The Checkbox has values, which correlate to Locales. The end goal was to create ...
4
votes
2answers
217 views

Adding new locale - hangs at Step 3 'ResaveAllElements'

I've looked at every option I can think of so hoping that someone can assist. We're on a dedicated server with full root access. We've got a relatively small site that now needs a Spanish locale ...
3
votes
1answer
839 views

How can I get the locales that are actually enabled for a given entry?

I can use getLocales() off of the entry model to get all locales in the system, and whether they are enabled by default for that entry type, but it doesn't actually return which locales are enabled ...
1
vote
1answer
300 views

Change asset upload path based on locale

We have a localized site with separate public directories. I'm looking for a method to handle image uploads for the different asset paths. For example when uploading an asset within a particular ...
1
vote
1answer
198 views

Pasting into redactor with Arabic

IS there a way of getting redactor to accept text pasted from arabic in a right to left flow? Should this be solved with custom style for editor based on locale? (Am already doing RTL direction in ...
1
vote
1answer
69 views

Dropdown template URI breaks on language switch

I have the following code in my header of a multilingual site. It produces the correct urls in english. {% for entry in menuentries %} {% if entry.entryLink.first|length %} {% set ...
2
votes
1answer
379 views

How to setup a multi-lingual site on IIS

I've been trying to setup my site on IIS, which runs fine on Apache, without success. My setup is this (with rewrites) / (loads craft for the admin panel) /en (loads the english homepage) /fr (loads ...
2
votes
1answer
2k views

Twig filter to convert special characters to URL friendly characters

I have a text field that will accept some German text in it as a headline of a section. I'm using Craft's |kebab filter to turn that into a lowercase-with-dashes id that my navigation scrolls down to ...
5
votes
1answer
57 views

How can I localize cpEditUrl?

I use the following code to link to the CP from the front end: {% if entry.isEditable() %} <a href="{{ entry.cpEditUrl }}">Edit entry</a> {% endif %} What do I have to add to link to ...
3
votes
1answer
100 views

Multi-lingual site with a splash (language select screen) at the root

I'm trying to get something working and I keep breaking my internal links doing it. Here's what I'd like: public/index.html (this page would be the language select screen and can be dealt with ...
1
vote
1answer
78 views

Multilingual MAMP port number siteUrl issue

I have my local dev setting up using MAMP on port 8888 'mydomain.dev:8888' => array( // ... 'environmentVariables' => array( 'basePath' => '/Users/mypath/SiteCode/mydomain/...
4
votes
1answer
834 views

Getting all entries from all locales

Can anyone confirm if I want to pull back a list of all entries regardless of locale I could do something like craft.entries.locale(null) to get 100% of entries?
1
vote
4answers
138 views

Translated URIs

I'm trying to change the URI of a single so on the german site it will show the translated URI. At the moment I'm just changing it here: However if I try to browse to /Über-uns on the german site I ...
1
vote
1answer
370 views

Get CP's current selected locale

Is there an easier way to get the CP's currently selected locale? In my plugin I am currently using this method. public function getCurrentLocale() { $id = is_array($this->value) ? $this->...
3
votes
1answer
225 views

Localization with categories

I am using Lindsey's Language Link plugin for my language switcher. Everything works well, as long as the url is not a category url. Here it is: {% set element = (entry is defined ? entry : null) %}...
2
votes
1answer
350 views

Live Preview in different languages on different top level domains

Our website offers three different languages. Each language has it own top level domain (example: domain.de, domain.it, domain.fr). Everything works like it should, except the Live Preview function. ...
1
vote
0answers
72 views

How can I disable automatic copy to new localized fields on first save of an entry?

Is there any way to stop this? It would be nice to stop this (for my purposes) and then tell the template to fallback to content from a certain locale if the current locale does not have content for a ...
1
vote
1answer
81 views

I want my custom field values to be stored on a per-locale basis, but can't seem to do this.

Currently building a multi-lingual site. Developing locally using WAMP. Using trial version of 'Craft Pro'. Followed the step-by-step instructions of Craft's Setting Up a Localized Site All works ...
2
votes
1answer
957 views

Retrieve entry field value from a different locale?

Is it possible to retrieve a field value from an alternate locale? I'm working on a multi-language dictionary website and it would be helpful to display values for an entry in more than one locale (...
2
votes
1answer
72 views

Separate time settings from user locale?

I would like to render the DateTime fields in the backend with european time format, even though the user I'm logged in with is set to English/US. Is this possible?
1
vote
1answer
203 views

If merging two sections from different locales how do I then sort them by a shared criteria?

I've got a site with multiple locales and I want to merge together content from across these locales, eg News. The two sections share the same fields so should theoretically be able to be sorted by a ...
1
vote
1answer
90 views

Show Matrix Assets from German language in other locales

I have a website with three locales (de, fr, it). On a Matrix Field i have Assets where are only uploaded in German language. Now i'm trying to show those assets also in French and Italian language. ...
0
votes
1answer
88 views

Combined entries from sections across locales

I'm merging entries from two separate sections across locales. All going well but when I try to paginate the results I get the following error: Recoverable error Argument 1 passed to Craft\...
2
votes
1answer
883 views

Multilingual slug setup

I'm setting up my first multilingual website with Craft. I'm struggling with multilingual slugs. This is how I'd like the slugs to look like. If I do this tough, I need to adapt my folder structure. ...
1
vote
1answer
160 views

When using “createElementSelectorModal()” how do you respect selected locale?

When using createElementSelectorModal() in a plugin, how do you make your source list show items from the current locale selected in the CP? It only seems to show the items from default locale no ...
2
votes
2answers
816 views

How to redirect site root to preferred language in multi-language site?

I followed the Craft directions for setting up a localized site. In the fifth step I followed the first example for setting up my folder structure. In my case the languages I'm working with are French ...

1 2 3
4
5
8