Skip to main content

Questions tagged [localization]

Locales and multi-lingual translations.

Filter by
Sorted by
Tagged with
25 votes
9 answers
9k 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....
KSPR's user avatar
  • 3,786
19 votes
1 answer
8k 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?
Brandon Kelly's user avatar
15 votes
2 answers
4k 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 ...
simonsweeney's user avatar
11 votes
2 answers
674 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 ...
Dan G's user avatar
  • 355
9 votes
3 answers
2k views

What accurately will set asset paths for multilingual sites?

This is actually a fairly crucial matter, since relative paths definitely won't work with languages, unless you really want all assets in a given Source to be localized or at least copied to each ...
narration_sd's user avatar
  • 1,707
8 votes
2 answers
4k 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 ...
Marion Newlevant's user avatar
8 votes
2 answers
350 views

Locale Switch not Affecting News Index Template

So I have successfully set up two locales on my site, with a button to switch between, this works fine for all the sections that have the langauges set, but I cannot seem to get it to work for the ...
simonsweeney's user avatar
8 votes
2 answers
2k views

Get locale entry.title in other languages

I'm trying to get the locale title (dutch: nl_nl) of an entry, in the english version of the same post. I want to do this so that on hover it shows the English title's Dutch version. Any help is ...
Kitsune's user avatar
  • 333
7 votes
4 answers
2k 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 ...
Broxxi's user avatar
  • 73
7 votes
2 answers
905 views

How to use localized categories properly?

I've setup a localized site (de/en) with custom routing for my categories (which are marked as translatable). I use a tag route for my categories which points to the same template as my structure. ...
m9dfukc's user avatar
  • 171
7 votes
2 answers
592 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 ...
Ben Parizek's user avatar
  • 13.5k
6 votes
2 answers
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 ...
Tyssen's user avatar
  • 653
6 votes
1 answer
881 views

Can I choose a language for the translate filter?

So I've built a language switcher as per this answer. I want the text for each link to be in the native language, for example I want the link to the English locale to say "Read this page in English" ...
mijewe's user avatar
  • 336
6 votes
2 answers
223 views

Show a list of recently used tags only from the current locale

I'm having trouble outputting a list of tags that only includes tags from the current locale. Here's the setup: I have a site with two locales: english and spanish I have a section with handle ...
Adam Snetman's user avatar
6 votes
1 answer
766 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/{...
Low's user avatar
  • 537
6 votes
3 answers
1k 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/...
Tyler's user avatar
  • 61
6 votes
1 answer
360 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 ...
Matt Wilcox's user avatar
  • 3,209
5 votes
3 answers
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 ...
narration_sd's user avatar
  • 1,707
5 votes
2 answers
3k views

How to add locales in Craft 3

I'm getting started with Craft, using version 3 beta, and I don't find the menu option for adding locales so I guess it's not yet ready but there must be another option. Could anyone guide me through ...
Rosana Ruiz's user avatar
5 votes
2 answers
9k 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 ...
Romain P.'s user avatar
  • 1,852
5 votes
2 answers
682 views

Can globals be localized?

In the multi-lingual site I'm building, I've created an "SEO" global set where my client can enter keywords and a description to populate meta tags site-wide. Problem: globals don't seem to be ...
Adam Snetman's user avatar
5 votes
2 answers
461 views

Possible to change locale in PHP?

I've got a plugin which is defaulting to English during AJAX calls, but I need it to stick to whatever the current language is. I can send the current locale through via AJAX data, but I'm not sure ...
Lindsey D's user avatar
  • 24k
5 votes
1 answer
690 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 ...
bert_teng's user avatar
5 votes
2 answers
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 ...
Darren's user avatar
  • 433
5 votes
2 answers
538 views

Licensing a multi-lingual site using different domains

I'm building a site for a multinational company. I have domains set up like this example: acme.com (main portal site, different from local sites, but also aggregating content from all local sites) ...
Jure Srpcic's user avatar
5 votes
1 answer
3k views

Unable to locate message source for category ''

I'm trying to update my plugin to Craft 3 and I'm getting this error message: Unable to locate message source for category ''. What does it mean?!
Ben Parizek's user avatar
  • 13.5k
5 votes
1 answer
454 views

Output localized urls in navigation

Does {{ url('handle') }} output the right url for localized sites? I have a fr/en site and both lang output the english paths, but shows the right content and language/strings on the page. I'm a bit ...
jlcharette's user avatar
5 votes
1 answer
78 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 ...
bennobo's user avatar
  • 115
5 votes
2 answers
334 views

Deleted Locale, Entries all gone now

I deleted a locale and checked to transfer all its contents to a different locale, but now the other locale still shows no entries. I'm sure all the entries are still in the database. Any help?
new_user12345's user avatar
4 votes
5 answers
7k 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 ...
Robbie Post's user avatar
4 votes
1 answer
392 views

What's that |t - filter for?

I found this part of code in the documentation {% set title = "Cocktail Recipes"|t %} What does |t mean there?
nicael's user avatar
  • 2,382
4 votes
2 answers
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. ...
Johannes Lamers's user avatar
4 votes
2 answers
241 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 ...
JonnyT's user avatar
  • 324
4 votes
1 answer
296 views

Can locales be used to switch layouts?

In my particular case I need to be able to switch the layout that the template extends. Is this possible to do using locales?
Ian Young's user avatar
  • 584
4 votes
3 answers
1k views

Change page elements based on geolocation

We would like to geolocate visitor IP addresses, and for US-based addresses render a portion of the page to display state-specific options. I actually have the PHP working well to pull the 2-letter ...
Neal Magee's user avatar
4 votes
1 answer
1k 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 ...
Rosana Ruiz's user avatar
4 votes
1 answer
103 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 ...
Tibor Szasz's user avatar
4 votes
1 answer
544 views

Problems with channel and locales

So I'm setting up a multi-lingual site for the first time, and I'm having some problems with the urls. I followed the guide, step by step. I've set up the siteUrl in general.php: 'DEV' => array( ...
peirix's user avatar
  • 431
4 votes
1 answer
932 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?
joep's user avatar
  • 610
4 votes
2 answers
835 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 ...
carlcs's user avatar
  • 36.3k
4 votes
1 answer
1k views

Getting full native language name in Craft 3 language switcher

I'm porting across a multilingual project from Craft2 to Craft3 and have to rebuild the language switcher. I was previously using the .nativeName method but apparently this is deprecated. I've got a ...
Dr_Codswallop's user avatar
4 votes
1 answer
791 views

Element API locale

Is it possible to get the right locale based on url? For instance http://example.com/entries.json gives english content while http://example.com/no/entries.json gives norwegian content? Or can I ...
Spoeken's user avatar
  • 327
4 votes
1 answer
574 views

Is it possible to translate the name of a field in the CP?

I have content editors that speaks different languages. Is there a way to translate the name and introduction of a field in the control panel? A simple {{ "value"|t }} seams not to work. Example: ...
Tom Bauer's user avatar
  • 1,327
4 votes
2 answers
1k views

Don't use localized slugs for templates

We are building a multilingual site. We have different domains and slugs for German and English pages/sections i.e. projects is called projekte... Right now the template used is called "projects....
nexflo's user avatar
  • 539
4 votes
2 answers
8k 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 ...
osh's user avatar
  • 615
4 votes
2 answers
1k 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: ...
Christoph Kepper's user avatar
4 votes
1 answer
449 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 ...
Ben Parizek's user avatar
  • 13.5k
4 votes
1 answer
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 ...
Russ Back's user avatar
  • 1,503
4 votes
1 answer
690 views

Save multiple locale data via plugin

I'm trying to import data from another database using locales, but am having trouble saving the other locale after the primary locale is saved. foreach($row as $data) { $entry = new EntryModel();...
Douglas McDonald's user avatar
4 votes
1 answer
146 views

Fetching localized globals?

I have a site that is mixed English and Chinese. I've properly set up the locale to include Chinese as a locale, and have put Chinese translations for my fields in place. That all works. However, ...
andrew.welch's user avatar
  • 11.6k

1
2 3 4 5
9