What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Questions tagged [localization]

Locales and multi-lingual translations.

Filter by
Sorted by
Tagged with
25
votes
10answers
8k views

How can I build a language switcher?

I'm currently building a site with two languages, and I need a language switcher so wherever you enter the website you can switch the language easily. I've come this far: {% for locale in craft.i18n....
15
votes
2answers
3k views

How do I create a locale dropdown to switch between languages?

I’m trying to create a dropdown menu to switch between language’s on my site. I am currently doing this with this snippet found on the google plus community: {% block locale__switch %} {# Loop ...
4
votes
5answers
5k views

Craft 3 language switcher

Does anybody successfully implemented a language switch run Craft 3? Trying the Craft 2 variant slightly adjusted but still running into issues: Invalid site handle: nl <ul> {% set otherLocales ...
5
votes
2answers
3k views

Locales sub directories on Nginx

I'm trying to get a basic locals sub directory system working on Nginx: /entry - en local. /fr/entry - french translation. /it/entry ect.. Having read this knowledge base article and some other ...
6
votes
2answers
1k views

Multi-lingual site navigation made of singles, channels and structure

Does anyone have any examples of how they've put together the main site navigation for a multi-lingual site set-up made up of singles, channels and structure? At the moment I've just hard-coded the ...
4
votes
2answers
6k views

Is it possible to output month names in my native language?

I'm doing this: {# Get events from `events` section in desired sort order #} {% set allEvents = craft.entries.section('events').order('eventsDate asc') %} {# Loop through `allEvents` and print the ...
11
votes
2answers
650 views

Can I change the list of available locales?

Is it possible, by any method, to change the list of available locales? The current list includes some strange entries, e.g. East Germany, and we would like to update this to be more current for our ...
4
votes
1answer
1k views

Retrieving an entry by ID in ALL locales

I've been looking at How can I build a language switcher? but I don't to hit the DB for each entry in the loop, just to get the entry's localised slug. However I can't see a way to get an entry by ID ...
3
votes
1answer
1k views

Duplicating Matrix fields with content from another locale

I'm working on an Element Action that will duplicate some fields from the primary locale, to whatever locale the user is currently in, if those fields are already empty. Asset fields seem to work ...
1
vote
3answers
450 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 ...
4
votes
2answers
1k views

How to build a great multi-lingual navigation with channels, structure, and manageable in the CP

I'm working on a complex website with multi locales, channels, structures and different designs per page. And the site needs a breadcrumb path. My client needs to manage and add items the to menu. ...
8
votes
2answers
3k views

Multilingual Dates where date format varies

I have a multilingual site, and I want my dates formatted like: English site: July 13, 2014 Italian site: 13 lulgio 2014 So the month name is translated, and the order of the elements changes as ...
7
votes
4answers
1k views

Locale change based on geolocation

I've gotten locales up and running on a site, but would like it to automatically route to domain.com/no for norwegian visitors and domain.com/en for all other visitors. For the life of me, I seem ...
4
votes
2answers
6k views

Craft 3: how can I set dynamic Base URL in sites setting?

Sites localized versions are setup using Base URL like this: — http://{baseUrl}/en/ — http://{baseUrl}/fr/ But {baseUrl} variables are not transformed using craft.app.sites.getAllSites(). {% set ...
4
votes
1answer
1k views

Localization - How do we manage multilingual, multi-environment on multiple domains?

I read this KB article about localization though, the examples are for sub-folders. I'm wondering how to handle the same concept but, for different language based domains e.g. example.com example.mx ...
4
votes
1answer
913 views

Craft 3 Multi-site with no “default” site

I have setup a Craft 3 multi-site with the following configuration: But what I really want is: Additionally, I want to have a 'default' http://localhost:8888 so I can always redirect to /en or /es ...
7
votes
2answers
370 views

How do you add support to manage content in multiple languages in a plugin with a custom Element Type?

We have a plugin with custom Element Types that allows a user to create a field layout using custom fields. We understand how to setup a localized site and add translation files. This question is ...
5
votes
3answers
2k views

How do I get Matrix elements to copy their content across language Locales?

I returned to a site designed months ago, and added a second language to it. From the beginning, this site had prominent composition of entries out of multiple elements in their matrix, with ...
5
votes
1answer
529 views

Is there a way to have checkbox field labels translatable?

So I have a checkbox field in the new entry editor page. Attached image is an example of said checkbox. Just a standard checkbox field. Is there a way for these checkboxes to be translatable? I'm ...
3
votes
2answers
667 views

Is there a better way to localise channel url?

I'm working on a bilingual site (en and cy) and have a news channel with entry urls news/{slug} and the translated cy/newyddion/{slug}. Everything is working well with entries and if the url is ...
19
votes
1answer
6k views

How do I output the locale’s name?

When I output {{ craft.locale }} in my template, I get the current locale’s ID (e.g. “en”) rather than its name (e.g. “English”). How do I get the locale’s name?
4
votes
2answers
807 views

Is it possible to manage language translations without directly accessing the PHP translations file?

It is beautifully described in the docs how to translate static text using translation files. As the client has no access to that file and managing a php array is not what I want them to do, I am ...
4
votes
1answer
416 views

How to create a query to group alternate language pages?

I'm trying to create a sitemap for a site with multiple locales. An example of the format is described here, but as a quick summary: I need to output locales of related translated pages aside one ...
3
votes
1answer
461 views

Auto generation of localised slug

When an entry is created and saved in a locale the corresponding entry is created for other locales using the original title. However, when the title of the locale which needs translating is edited ...
3
votes
1answer
195 views

Localized ElementTypes in a plugin

My question is re: localization of ElementTypes in a plugin. I have the records all working fine in multiple locales. The part that I'm not "getting" is I think there should be one Element in ...
3
votes
1answer
3k views

Export Craft Data

I need to export all content from a Website to be translated by a translation company. Is there some sort of content export plugin who exports the content into a readable form? The other option is ...
3
votes
2answers
805 views

How to extract static messages from templates into translation files?

I use Craft on multilingual site and I'm having some difficulty in getting the static messages on templates added or changed on every translation file I have. Is there any way to extract those static ...
2
votes
1answer
587 views

What is the difference between the Translation Methods when creating a new site

I am creating a new multi-lingual site and the documentation does not explain the difference between the options in the translation method dropdown. What is different for each of these and when is it ...
2
votes
1answer
522 views

Detect if a language is translated or not

For entries where the content isn't translated yet I'd like to add a "Sorry not translated yet" message. Since all the content is synced is there a way to check if the synced content is the same as ...
1
vote
1answer
316 views

Show entry content for other available locales

We need to part translate a site, and by which i mean only certain sections are available in other locales, and only certain Entries in those pages. In order to display these in the front end we ...
1
vote
2answers
835 views

How do I redirect to a corresponding route when user switches languages?

I'm working on a multilingual site with english and spanish locales. I've built persistent switcher that resides in the site footer. When users click it, it redirects to a corresponding entry in the ...
1
vote
1answer
410 views

How can I add in new Locales to the locale list? [duplicate]

I have a site that has a few different countries that speak the same language but want to have them as different Locales. Mexico (english) Mexico (spanish) USA (english) USA (spanish) Peru (english) ...
1
vote
1answer
372 views

German locale & English CP language resulting in disappeared entries

I have just one locale (German, de). Now, I've changed my CP language to English ('defaultCpLanguage' => 'en' in general.php). But now, all my entries have disappeared in the CP (Craft Pro 2.4.2670). ...
1
vote
1answer
278 views

How to change the locals name in Localized Sites

I am developing multi-sites with the locals. Everything is fine. Is it possible to change the name of locals. I 'd like to give some other names to locals so that those can be more clear while ...
1
vote
2answers
431 views

Way for clients to edit translation file(s) in control panel?

We have some navigation links being translated via the /translations folder but the client needs the ability to change them too... Is there a way to make the translations editable from the control ...
1
vote
1answer
912 views

Return to specific locale based on cookie?

If we are storing a cookie of a locale the user choose, is there a way to detect that cookie in htaccess so the next time they visit the base url of the site it will take them to the same locale?
1
vote
1answer
649 views

Multiple databases, single codebase

We have two sites that more or less share the share the same design, so we're thinking of having a single craft instance, but with DB config pointing to two separate DBs. The idea being you can ...
6
votes
1answer
277 views

Fields applied to the User area are not translatable?

I have a site which allows people to register as a member from the front end. I've got a bunch of fields attached to the User so that each person can build their own extended profile page; the site is ...
6
votes
1answer
729 views

How do I get the right entry data based on locale and slug?

My site has 2 locales: en_us and nl_nl. I also have a Structure section called Pages, which targets both locales. For each locale, the section has an Entry URL Format: en_us: en/{slug} nl_nl: nl/{...
5
votes
3answers
981 views

Multi-locale pages 404 on subdirectories

I'm developing and running a Craft site locally through Laravel Homestead and am having issues with pages 404'ing in a multi-locale setup. I've followed this guide closely: https://craftcms.com/docs/...
4
votes
2answers
733 views

How to transform German umlauts when creating slugs?

First of all, I want to thank you for creating Craft. It's really one of the best content management systems I have ever worked with. I encountered an issue while working on a multilingual site: ...
3
votes
1answer
238 views

Fallbacks for assets not avilable in a locale

I have a site with a lot of asset fields, the assets are translatable. The client has added lots into the English fields but many of the Welsh ones haven't been populated. I want to have things fall ...
3
votes
2answers
444 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
297 views

Craft 3: how can I auto-redirect to a site version using the user IP?

I have set up multi-sites using several locales: — International Website — English — Local Website — French — Dutch — etc. If the user has a French or Dutch IP, it should be auto-...
2
votes
1answer
158 views

Use of localeEnabled(): bug or misunderstanding?

localeEnabled(false) does not seem to do anything or I'm misunderstanding its use. I'm on Craft 2.6 and have this code: {% for region in Craft.entries.section('handle').level(1).localeEnabled(false)...
2
votes
1answer
374 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
1answer
197 views

Product price format in euro

I have a Craft/Commerce set up with Euro is base (and only) currency and 3 locales are defined in the site (nl_be, fr_be and en_be). Prices are showing up as: 0,99 € instead of €0,99 When I ...
1
vote
1answer
528 views

URI is not a valid URI [closed]

I'm getting an interesting (new) error when adding (or editing) entries in Chinese. If the slug is in Chinese I now get the following error: URI is not a valid URI It's interesting because I wasn't ...
1
vote
1answer
101 views

Restrict a users permission to only edit 'translatable' fields on a specific site?

We would like to have a 'translators' user group, where the members can edit only the 'translatable' fields, but not the non translatable things (images, categories etc). May be i missed something, ...
1
vote
2answers
377 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. ...