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
0 votes
0 answers
15 views

Translation in JavaScript file doesn't work [closed]

I am using Drupal 9 and Laravel-mix for the front end setup. In my JS file I tried to translate the sting with Drupal.t('the string'); The string can't be found in the Translate UI if I use yarn build....
user avatar
0 votes
0 answers
17 views

Correct translation settings for simple setup

In D9, I am trying to set up simple translation but am having 2 issues. The site is English with Spanish as the alternate language. We're using the Dropdown Language selector. The content types and ...
user avatar
0 votes
1 answer
46 views

Always keep admin UI in the same language when translating content

I have set up a page with two languages (English, German). I have two users, one should get the German backend and the other user only understands English, he should get the English backend. The ...
user avatar
-1 votes
0 answers
25 views

Drupal.t() not working well

I try to translate some labes in JS in user interface language with the function Drupal.t() but it's not working even when i add in dependencies:{ - core/drupal - core/jquery } and clear all caches
user avatar
0 votes
1 answer
32 views

using 2 language switchers in the same node

So i am not sure if this is doable or not, I am trying to add 2 language switchers block to the same node. I would like to have one language switcher for my content type that will be in charge of ...
user avatar
0 votes
1 answer
37 views

How does importing a contrib module's translations work?

Drupal version: 9.3.13 Basically, I'm trying to understand how using a contrib module's translation works. I want to be able to download and use the translations from the Drupal infrastructure, and ...
user avatar
0 votes
1 answer
65 views

Set a <front> page for different languages?

Is there a way to specify the front page per language of a Drupal 9 site? I am looking for an interface that allows this to be set by a user.
user avatar
  • 26.5k
2 votes
0 answers
31 views

How can I provide language-aware URL patterns for Pathauto?

I am using this pattern in Drupal 9 Pathauto to generate URLs: [node:menu-link:parents:join-path]/[node:menu-link] This does however not seem to work when using translated content. The generated URL ...
user avatar
1 vote
0 answers
54 views

Field Label Translation not working

I have a Drupal 9 site. The default language is English, second language is German. I keep having problems with translations in the backend. Lots of field labels and other text shows up in English, ...
user avatar
1 vote
1 answer
29 views

What is the correct way to set language used by a modal form?

I have a button linked through a controller to open a custom form in a modal: The controller callback is: /** * Callback for opening the modal form. */ public function openShareLinkModalForm(...
user avatar
  • 907
-2 votes
1 answer
43 views

how to set Default translated texts in twig file [duplicate]

I developed a twig plugin (to display graphs from a webform). These plugins contain English texts; And I want the same file to keep translations for several languages by default (for example, Arabic), ...
user avatar
0 votes
1 answer
23 views

Can't save field translation

I have 2 languages on my site (English and Russian). I also have a content type "Home page" and some fields are translantable (configured in admin/config/regional/content-language) After ...
user avatar
  • 1
2 votes
0 answers
33 views

How to show content that is not yet translated (Untranslated Content)

I am fairly new to Drupal – spent the last 3 months getting to know my way around. I have one question. I have to create a multi-language site for English and German users. I'm the site administrator ...
user avatar
  • 21
0 votes
1 answer
35 views

Views Block Language Detection

I have a site with two languages (EN/FR). I have a Content Type (Article). I have a Block built with Views that is displayed on the Article Node page. This Views Block has a translation. When the user ...
user avatar
  • 556
0 votes
1 answer
46 views

Allow module configuration per language

I have a module that lets site editors enter plain text title and description for a sitewide element. This site supports several languages - how can I enable entering values for each enabled language? ...
user avatar
  • 26.5k
0 votes
2 answers
27 views

How to translate front but keep admin in FR

I have a website with translation by domain, ex : monsite.fr fr.monsite.ca en.moniste.ca ... But in admin i'd like to stay on monsite.fr/admin whatever content that i translate, is it possible ? ...
user avatar
1 vote
0 answers
24 views

Views: how show a link to the translated entity?

I'm on D9. I've a View of moderated content nodes, so of Content revisions elements. Those nodes are also translatable: the default language is it and the eventual translation is en. The views ...
user avatar
  • 490
1 vote
0 answers
12 views

Unwanted fields added to translation

I have a node with only 2 fields to translate (regular fields, not paragraph fields). When I create a translation job (with tmgmt), I got those 2 fields (nice) and 2 others coming from a non ...
user avatar
  • 554
-2 votes
1 answer
26 views

How can make a string used by a view translatable?

I have a Events view that is added from the Fullcalendar View module. Is there a way to translate specific strings used from that view?
user avatar
  • 67
1 vote
1 answer
138 views

Dynamic language links from menu?

I am trying to find a way to do the following: Add languages to Drupal 9 menu items Translate content/menu links Provide (from the Main Navigation) a list of languages the current page is translated ...
user avatar
  • 26.5k
0 votes
0 answers
16 views

Can you add a node's translation to a different menu that the source node?

I would like to add a node's translation to a different menu than the node's source. Is that possible? For example, English is placed in main menu and french translation is placed in a different menu.
user avatar
  • 23
0 votes
1 answer
44 views

How set html 'lang' to match node 'langcode'?

I would like to change a node's html 'lang' from site's default to the node's 'langcode'. For example, if I create a node and while creating I select French as the language, I would like the page's ...
user avatar
  • 23
1 vote
0 answers
26 views

How to publish latest revision langcode programmatically in each translation

My workflow is draft, publish and archived. My translations are 'en(default)', 'fr', and 'de'. My clients create a lot of nodes in draft status for their release. We must release these latest ...
user avatar
0 votes
0 answers
20 views

How can I load a translated version of my custom config? [duplicate]

I created a custom configuration form that can be translated into all available languages. My question is how we can get the translated version of the configuration for a specific language on the ...
user avatar
0 votes
1 answer
54 views

Is it possible to render a View based on the Content language?

Drupal supports the concept of Interface Language and Content Language. I (and every client I have ever asked) seem to have a different opinion of what is "content" and what is "...
user avatar
  • 907
0 votes
0 answers
22 views

How to get language prefix in URL for terms without translation?

I have a multilingual website with taxonomy vocabulary, which terms are not translatable (company names). But each term has translated meta tags and paths, depending on the selected site language. For ...
user avatar
  • 79
0 votes
1 answer
72 views

Drupal 9 core multilingual: cannot translate main navigation menu - button translate missing on menu items

I'm trying to catch multilingual features of Drupal 9 and have wamp64 local development server and clean Drupal 9.2.8 install. I've enabled 4 multilingual core modules: Configuration Translation, ...
user avatar
1 vote
1 answer
116 views

How to translate the layout builder blocks of a node programmatically?

I am translating the nodes programmatically. Everything works fine except the layout builder blocks. When I try to translate it, it also changes on the source node. I have created a node in language ...
user avatar
  • 2,697
1 vote
0 answers
27 views

URL aliases for non-translated content types revert to /es/node/nid in menu

I have Content Translate enabled and enabled translation on only our Projects content type. I've placed the Language switcher block on a Projects view and Project node page. This is working just fine. ...
user avatar
  • 440
1 vote
2 answers
132 views

How get webform translations programmatically?

I'm on Drupal 9. I need to load the options labels of a Webform's option programmatically. So far, I've managed to load the labels: $element = $webform_submission->getWebform() ->...
user avatar
  • 490
1 vote
1 answer
26 views

Machine-translate a node by menu link

I have an "About us" main-navigation menu link. I want to create several other main-navigation menu links, in languages other than English, which will link to that very webpage, for example: ...
user avatar
  • 17
1 vote
1 answer
58 views

How to add link to translated content in text field

I need some help on a multilingual D9 site, trying to add links to translated node in text field. In German version should be a link to the English and French version of this node, as part of the node ...
user avatar
  • 147
0 votes
1 answer
22 views

Multi-lingual Webform, not entire website

Our client does not need their entire website to be translated into multiple languages. However, they have a webform that provides a number of different languages in a dropdown, and would like the ...
user avatar
  • 423
0 votes
0 answers
35 views

Setting a domain on URL language detection configuration creates an error

admin/config/regional/language/detection/url I selected the "domain" option, and set my english to example.com and my french to french-example.com. When I saved the page, I got the error, &...
user avatar
0 votes
1 answer
57 views

How can I get a list of all languages translation that a node has?

I'm trying to get a list of language translations that a node has in theme_preprocess_node(). I have the node object and can check for a translation on a one-by-one basis, if I have the list of ...
user avatar
0 votes
0 answers
11 views

View with translation not working as expected

I have a view that filters content (films) by category and it works as expected. I've added a new language to the site and some categories are not applied in both languages to the same content, but ...
user avatar
  • 83
2 votes
2 answers
108 views

Translation of a multilingual site into English

Note: This question is only focused on strings inside source files (PHP files). When you are creating a Drupal site in a non English country (let say France), you will create all your PHP files with ...
user avatar
  • 554
2 votes
1 answer
124 views

How do I create multilingual user path aliases?

I'm setting up a multilingual site, and I need the user path aliases to be multilingual. Users are set up as translatable: Language Detection: URL (path prefix) English: /en Japanese: No prefix ...
user avatar
  • 14.7k
1 vote
0 answers
19 views

Generate same Path aliases for multi languages

I have a content type Products. A pattern is defined via the Pathauto module for product CT. but my issue is that when I translate an entry/node it generates a translated path alias for Urdu in Roman-...
user avatar
2 votes
0 answers
100 views

How to use a module-relative path to translations in .info.yml

I'm new to using Drupal and am building a custom module to learn how it all works. I'm building my module in modules/custom/my_module. I have a Dutch locale file in modules/custom/my_module/...
user avatar
1 vote
1 answer
30 views

How can I tell, in hook_form_alter(), if a node form is for the node in its default language or a translation?

I'm implementing hook_form_BASE_FORM_ID_alter() in a custom module. I'd like to know if my form is for the node in its default language, or a translation of that original node.
user avatar
  • 7,123
2 votes
0 answers
54 views

In the context of a multilingual site, what is considered "interface text" and what is "content"?

On the Language Selection and Detection configuration page (in the toolbar, Manage > Configuration > Regional and language > Languages > Selection and Detection), I see that I can detect ...
user avatar
  • 7,123
0 votes
1 answer
39 views

How to translate content but not backend interface?

I'm trying to set up an English administrator back-end and a URL based front-end (anonymous user content) translation. I follow a guide on the subject, but I haven't been able to achieve what I wanted....
user avatar
  • 105
0 votes
0 answers
38 views

get translation programmatically of field value in specific language

I have created a content type (pdf_form) to which I added a field_gender_languagetest with two options, male and female. I translated both the options in German using the translation tab. Now I am ...
user avatar
-1 votes
1 answer
44 views

Custom translation function

I need own translation function in my custom module where i have defined language codes ('en','ja','de'....etc) Now i just wanted to pass word and language code as a parameter and it returns ...
user avatar
1 vote
4 answers
2k views

Error when updating translated content

I have fought for some time with the error below: Non-translatable field elements can only be changed when updating the original language. I have "inherited" a site a few years ago and ...
user avatar
  • 27
0 votes
0 answers
24 views

Content Translation installation breaks the website (statistics module error + aliases not taken into account)

First, I would like to say I am a total noob in Drupal and PHP but possess some knowledge on other web frameworks/languages). Here is my path to the errors: I used the UI to install Content ...
user avatar
  • 1
0 votes
1 answer
199 views

Translating Menu Item Programmatically?

I have been trying to translate menu items programmatically but upon saving it just adds the english field value to all my translations. Below is the code I am trying to execute: if ($entity->...
user avatar
0 votes
2 answers
63 views

Language switcher block is different on remote site

I'm working on a multilingual site and on my local version of the site I added the default language switcher. It show like this: <div class="language-switcher-language-url block block-language ...
user avatar
  • 892
1 vote
0 answers
182 views

How translate custom email programmatically?

I'm on a D9 Site. I've created a module, where I define a hook_mail, a hook_theme and a preprocess for swiftmailer twig: function my_project_breakout_rooms_theme() { return [ '...
user avatar
  • 490

1
2 3 4 5
38