Questions tagged [i18n-l10n]

Use it in questions about adapting software to different languages, regional differences, and requirements of a target market (locale).

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

Restrict language based content editing for nodes and blocks

I am running a D7 multi-language site. I am looking for a solution to restrict node AND block editing for english language, only. The editor should not be allowed to edit french content. How can ...
-1
votes
1answer
94 views

how can i make a twig node path variable multilingual compatible in a view template?

I have not found the path field in a view so i have added in my template for views_view_fields. <div class="cell small-12 event__link"> {{ fields.view_node.content }} </div> This ...
0
votes
1answer
18 views

Can I use I18N or another module to house regional variations of a site in a single installation?

I have a large build coming up and am planning to attack it in Drupal 8. The client will have three regional variations of their site, a .com, a .co.uk, and a .es. The goal is for them to look like ...
1
vote
0answers
127 views

Drupal 8 Change langcode of all nodes

How can i change the langcode of all nodes? I have tried UPDATE node SET langcode='und' But it still sais 'English' on node edit.
4
votes
3answers
1k views

View: Link to content is always rendering in the default language

I have a View that is list of a content type using fields. (I am also using a Relationship and a Contextual Filter, btw.) One of those fields is "link to content". The content type is translatable. ...
0
votes
1answer
29 views

Redirect .com domain to .dk/en

I have a site; www.example.net. If you type www.example.com it redirects to www.example.net which is okay. On my site i have to different language prefixes /da and /en that you can switch between. ...
2
votes
1answer
1k views

Translate a JS string from interface translations doesn't work

I've a problem about string translations. I've built a multi-language site and in a custom module, in a JS file, I've used the function t() to make translatable some strings. These strings appear in /...
0
votes
0answers
26 views

Entity Translation broken

When I create a node with entity translation and choose a language the field body is wrong. language = 'en' field_body[und]. This only happens with a specific content type and with new ones, not ...
0
votes
2answers
47 views

relative path in blocks - multilingual - does not work

I'm using Drupal 7 with i18n modules. I have 6 languages on my site. The relative paths are working fine except for: the relative paths in blocks for the languages other than the default language. On ...
1
vote
1answer
87 views

Drupal 8 - Check if language prefix is present in url or not

Is there a way in the drupal 8 api to figure out if a language prefix is present in the url or not? Cause I need this information in order to display a custom language switcher if no prefix exists in ...
1
vote
0answers
54 views

Export all translatable string/content/fields/interface to a csv file or alternative

I know there is node contents and fields that need translation, interface element translations, views title/footer translations etc Is there an export for all these that can ideally later be ...
1
vote
2answers
253 views

How to create a view that display on the same row a field and its translation

Let say I have a content type with 2 fields that can be translated in a 2 languages site (EN-FR): the title and field_tobe_translated I would like to list (in a view) all nodes of this content type ...
0
votes
1answer
211 views

Language switcher using get language variable instead of prefix in Drupal 8

In Drupal 8 setting url with path prefix for language detection, works fine. But when I include the language switcher block included with Drupal, the links instead of using the language prefix, show ...
0
votes
0answers
301 views

Strings send for translation inside twig never displayed as translated

I have this code inside node.html.twig {{ 'string'|trans }}` I can see the string and translate it inside the UI but the string is never displayed I have also tried {% trans %} string {% ...
3
votes
1answer
167 views

Why do some webforms have their elements value in translation UI (/admin/config/regional/translate)?

I have enabled webform module on a Drupal 8 installation. For some reason, there are default webform templates such as "Donation" and "Contact Us" which have their elements values translated in the ...
2
votes
0answers
224 views

CKEditor Internal links are not prefixed with language

I have a multilingual Drupal site and I noticed that the paths of relative links added by CKEditor ignore the current language prefix and redirect to that node pages with default language (ie. /cn/...
0
votes
0answers
44 views

dns-prefetch on multi language site - only shows on one, incorrectly

During an automated search for broken links on our sites I found this faulty line in the <head> section in ONE of our sites (out of 8 TLDs running on the same Drupal installation): <link rel=...
0
votes
1answer
212 views

How do I programmatically add a new language?

I am using Drupal 8 on a multi-lingual site which uses Arabic and French. I need to programmatically add a new language from a custom module. How can I do it?
0
votes
1answer
32 views

How do I translate a view's “Menu tab”

I am on Drupal 7.56 on a multilingual site. I have created a view that contains tab menu links. Almost all the site it available now in two languages. But I still can't translate those view tab menu ...
0
votes
0answers
20 views

Views displaying content with link to en-US when it shouldn't

We have a site that has all its content translated for American English. Detection is through the URL via en-US/ been added to the paths. I have a number of views returning content from specific ...
0
votes
2answers
235 views

Migrate Paragraphs from CSV

I am migrating Paragraphs from CSV file. I have Paragraph called Text with two fields -> title and body. The problem is that I would like to also migrate translations for them, which currently don't ...
0
votes
1answer
71 views

Drupal 8 status code set 301 instead of 302 for urls with out lang code

I have an article with url alias '/gettting-started' and it is translated in several languages. Lang codes for other languages is set like the following. For German:de-de, English: en-us. In 'admin/...
0
votes
1answer
295 views

Taxonomy term not displayed in the current language

My setup is simple: A content type "film" with a taxonomy field "Type of film". The content type "film" is translatable, but not the field "type of film" (same type for all languages): only the ...
0
votes
3answers
656 views

Is there any way to redirect page to front page, if it isn't translated?

Is there any way to redirect page to homepage if its translated page not found. Suppose my page url is /en/node/237, If I switch translation from English to German /ge/node/237, if it's translated ...
0
votes
0answers
1k views

Getting a translated URL in a Node TWIG template

I was referring to this documentation, but am unsure if what I'm trying to do is possible: https://www.drupal.org/docs/8/theming/twig/functions-in-twig-templates#path In the section, it refers to ...
0
votes
0answers
85 views

How do I show only language specific and translated taxonomy terms in a field which references a taxonomy?

How do I show only language specific and translated taxonomy terms in a field which references a taxonomy? In my xyz content type I have taxonomy reference fields. While translating the content ...
-1
votes
1answer
395 views

Remove default language prefix from URL in Drupal 7

I have started to create a website using Drupal 7. I have website to use multi-language functionality. How do I remove default language prefix from URL.
0
votes
1answer
72 views

Image block module translate

I have created block using image block module. I want to translate block content in other languages. I have used i18n module for translation. currently I only translate the title of the block. But I ...
0
votes
1answer
148 views

How to translate a French site into English without doing it manually throught the UI

I have installed a Drupal 8.5 site in French (monolingual). Then, I added content. Of course, there are many strings in the PHP files of my custom theme/module I pass to t(). There are also many ...
0
votes
1answer
385 views

How to check if an edited form is editing a translated node

I have a content type named film. Original language of a film is FR. Let say I have 2 translatable fields on a total of 10 fields in film. I am using this code to alter the add/edit form of film: ...
1
vote
1answer
80 views

Should I translate string inside a Unit test?

I have a Unit test where I need to print a string so I decide to use the t() function to translate it: $this->assertTrue(is_numeric($expected), t('Parameter is numeric.')); But the problem is ...
4
votes
2answers
3k views

How do I get the translated title of a node?

I have a content type available in FR and in EN. In hook_node_presave(), I would like to concatenate the French title and the English title in another field. (This is an "helper field" which contains ...
0
votes
0answers
87 views

Changing confirmation page url dynamically after webforms submission

We have a single webform (Built using https://www.drupal.org/project/webform ) with a confirmation url of /thank-you The same webform is displayed/used also if you originated from a translated page. ...
0
votes
1answer
165 views

Menu translation tab how-to?

I have a menu in the original language English. Spanish is active in admin/config/regional/language . Custom menu link is active in admin/config/regional/content-language . I now have a Translation ...
0
votes
1answer
21 views

Language switcher give 404

I need to translate part of a website. So I had enabled necessary modules : content translation, i18n + i18n sync. Then create some translation of 2 differents content type (after setting them to ...
0
votes
1answer
17 views

Replicating a Node with Replicate UI Leads to an Incorrect Hreflang Tag

we are using the Replicate UI module to replicate nodes and then changing the new replicates language to build up our site in different languages. However, we are seeing an issue with our Hreflang ...
0
votes
1answer
83 views

Drupal 8 translation for routing titles

In Drupal 8, I installed all translation modules (Configuration Translation, Content Translation, Interface Translation, Language) and cleared all caches and run cron again. But the titles defined in ...
1
vote
0answers
15 views

Traslation reset issue while upload on server

I'm facing strange issue on server. Using bitbucket & git for file & data management. When data push to our development server 5-10 translations always reset to English. We have 2 languages ...
2
votes
1answer
523 views

Multilingual article should display 404 when a translation is not available

I setup Drupal 8 with 2 languages English & Arabic. Now when an article (English for eg.) does not have a translation (in Arabic) and the user switches the language from the menu. The page loads ...
1
vote
1answer
238 views

Multilingual comments in Drupal 8

I set up an English/Arabic Drupal 8 website. However, comments are misbehaving. When a user enters a comment in the English version of the article, it appears in the Arabic version, and vice versa. I ...
1
vote
0answers
18 views

How to path a node with different translations?

I'm using the REST Api to get my Drupal content into an App. This App has to be translated to at least 8 different languages, so i'm using crowdin as a translation service. I wrote a small module that ...
0
votes
1answer
1k views

Permission errors

What file permission should I change to fix this error? The specified file temporary://fileo7XApl could not be moved/copied because the destination directory is not properly configured. This ...
0
votes
1answer
47 views

Module always returns the default language in hook_theme()

I am developing a custom block that shows a different image URLs for different languages. Currently, I enabled English and French. The code I am using is the following one. function MODULENAME_theme(...
0
votes
1answer
261 views

How to remove a term programmatically from entity reference field using entity browser on translation form?

I have a content type "Articles", this is a multi-language site, by default the content is created in English, and then translated into Spanish. On new article in English, I set a title and a term for ...
1
vote
1answer
100 views

Getting node in theme_preprocess_node

I have this code: function material_base_preprocess_node(&$variables){ $node = $variables['node']; $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $...
0
votes
1answer
148 views

Javascript translation broken - fixed after cache clear

I just encountered a problem with the javascript translation. I have a javascript file where I generate small UI elements using jQuery, and I wrap the label in the Drupal.t function. The site is ...
0
votes
1answer
76 views

How can you filter out other languages Taxonomy Terms from an exposed filter?

I am working on a View for a content type which has a Taxonomy Term field. The vocabulary is setup with the Translation mode 'Translate'. The terms have all been translated so that the terms ...
1
vote
2answers
64 views

How to translate a node in a custom block?

I know that the question has been asked several time but I didn't find how to get the translation of a node entity. Here is the code : $countries = \Drupal::entityTypeManager() ->...
0
votes
1answer
14 views

Separate domain for a single language

I have a website with three languages (Polish, English, and French) with English being the default. English and French should use a URL like domain.com/en and domain.com/fr; Polish should use a ...
0
votes
1answer
49 views

Drupal 7 - Internationalization module - some blocks not visibile (i18n)

After adding the Internationalization module for Drupal 7, I am having some trouble with a particular block not showing up when switching languages. I set the block to be translatable (and set full ...