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
0answers
26 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 ...
0
votes
1answer
36 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 ...
0
votes
1answer
66 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 ...
0
votes
0answers
21 views

How to export view's translation?

I used view translate(/admin/structure/views/view/my_view/translate) to translate a filter's label and saved. When I refreshed the view, it worked. Then I went to /admin/config/regional/translate/...
0
votes
0answers
24 views

How do I install Drupal with multiple custom languages using drush?

I know I can install a new Drupal web site with single custom language using: $ drush si standard \ --db-url='mysql://[db_user]:[db_pass]@localhost/[db_name]' \ --account-name=admin --account-...
0
votes
0answers
21 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 ...
0
votes
1answer
14 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->...
0
votes
2answers
49 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 ...
2
votes
0answers
41 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 [ '...
0
votes
0answers
8 views

Enabling field translation for content type causes node to not show value for that field

I am using Drupal version 7.80. I have a content type called "Public Resource" that has a bunch of fields. The content type has "Enabled, with field translation" for the ...
0
votes
0answers
26 views

How to display files by language

Is there a preeve of concept way to upload or display files translated in different languages. So for example if there is a site with German, English and Spanish. How to upload and display different ...
1
vote
2answers
60 views

Translate tab missing

I am working on my first multilingual Drupal 9 website, and I face a challenge. I can't seem to get my contact webform elements translated. I am using Webform Version: 6.0.2. I have enabled ...
0
votes
0answers
31 views

translatable content: how to set default original language

I've a D9 site, configured with two languages: Italian (default) and English. Some content types of the site are translable, the configuration under admin/config/regional/content-language for them is ...
0
votes
1answer
87 views

Programmatically add a translation with proper content moderation state

I am trying to add a node translation programmatically when a node is created (using hook_ENTITY_TYPE_insert). My code works fine except that the translation doesn't really have a content moderation ...
1
vote
1answer
47 views

How to allow user to manually change language when using “Browser” Detection as a detection option?

We have a site with multiple languages and have been using the Language Switch Dropdown menu to allow users to change languages on the site. But when we add "Browser | Language from the browser's ...
1
vote
1answer
68 views

How to print the paragraph field translation value in twig template

I am trying to access the nested paragraph field inside my twig template. {% for items in item['#paragraph'].get_aw_title_details%} {{ item.entity.field_award.value }} {% endfor %} When I am using ...
4
votes
0answers
37 views

What is the difference between Translation language, Translation source, and Original language?

Would anyone be able to explain to me what the difference is between "Original language", "Translation language", and "Translation source"? I think I have a pretty good ...
1
vote
1answer
27 views

Disable menu link for certain languages

I'm looking for a way to disable a single link in a menu for a certain language. From my understanding with similar issues, I'd like to activate translation for the menu link field Enabled since this ...
0
votes
0answers
29 views

New language defined and set to default, original language on config translation still remains English

I have installed languages and set one of them as default, but still numerous things, for example Translations for User account menu block (admin/structure/block/manage/bartik_account_menu/translate) ...
1
vote
1answer
29 views

Create link to node in specific language

So I need to create links to specific translations of a node but am having issues. This is my code: foreach($entities as $entity) { $urls[] = Url::fromRoute('entity.node.canonical', [ 'node' =&...
1
vote
1answer
52 views

Editing a node deletes body content reproducibly if Locale module enabled

I am experiencing a pretty serious problem leading to data-loss in D7. Editing any existing node leads to empty body content and newly created nodes have no body content whatsoever. Update: The error ...
2
votes
0answers
23 views

At creation time, why are shortcut titles translated, but menu link titles are not?

The idiom that the community points to for creating menu links usually looks like this (from \Drupal\Tests\language\Functional\LanguageSwitchingTest::testLanguageSessionSwitchLinks()): // Add a link ...
0
votes
0answers
30 views

How can I delete a field translation in node?

I am using a complicated melange of paragraphs with asymmetric translation, and in a few my nodes there is a stubborn translation that somehow is stuck. Its a node that used to be translated, but then ...
0
votes
0answers
21 views

Multiple translations of Paragraph content - EN / ES work, FR displays EN

I have gone through the documentation several times and started from scratch with a new EN node, translated Body and Accordions to ES (works!), then back to the EN, Translate, FR, add all the same ...
2
votes
0answers
50 views

Configuration export via drush randomly change the value of labels\other content in multilanguage sites

I've a multilanguage site, with Italian set as default and English as secondary language. When exporting the configuration via drush - drush cex command - sometimes the labels of other kind of content ...
0
votes
0answers
15 views

“created date” issue with multiple languages

I am working on a site with 3 languages: English, Finnish, and Swedish. The default language is Finnish; the site is using English and Swedish translations. I sent a request to Drupal with Postman ...
0
votes
1answer
51 views

How to use addTranslation() on an entity's multi-value paragraph?

I'm trying to programmatically update a multivalue paragraph field and add a translation. In the code below field_product_description is the paragraph's field that I'm updating and ...
0
votes
0answers
23 views

How can I create a Node Paragraph's image translation programatically?

I'm trying to create a translation on a node's paragraph field whose paragraph contains a text field and an image field. The code below updates the text field as expected but the image field is always ...
2
votes
2answers
165 views

How do I set a Node's Paragraph field in a different language programmatically?

I have a node that has different translations already and I'm trying to populate Paragraph fields in different languages programmatically. I can edit the node and update the paragraph fields manually ...
0
votes
0answers
16 views

Translation doesn't load other languages

I installed the Entity Translation and the Webform Translation modules. I enabled the webform translation from the entity translation configuration, and tried to translate a webform field. Only ...
1
vote
0answers
58 views

Enable language selector for Paragraphs Library

I am using paragraphs on a multilingual Drupal 9 page. Everything is working fine, I can translate basic pages with paragraphs to get a multilingual node. I have now enabled the Paragraphs Library sub ...
1
vote
1answer
91 views

How do I programmatically translate a string?

I am working on one custom module to alter the fields labels of user login form for visitors. I created a module to alter the labels in the user login form. The French language is enabled on the setup....
1
vote
0answers
33 views

How to make the language of the subscriptions be the currently language in Simplenews

I'm implementing simplenews on a Drupal 8 Website, and I currently came across a problem with the anonymous user subscriptions to the newsletters. According to the documentation of simplenews, when ...
0
votes
0answers
32 views

Content translation not working on the front page

I have a translation problem on my site in drupal 9.1.3. I have a content type for my homepage that contains two fields: field_slides which is an EntiyReferenceRevisionFieldItemList to a Paragraphs ...
0
votes
0answers
51 views

Get node translation from JSON:API

I have over a dozen languages on my site and we use Json:Api since it's a decoupled drupal. Problem is that I can't figure out how to get the translated node values from the Json:Api response. The ...
1
vote
0answers
25 views

What can I use as a unique identifier between a node and its translation now that the “tnid” field is no longer available?

We are upgrading our site from D7 to D8 and a part of this includes sending data out to another resource, specifically, Nodes. When we send data to the 3rd party resource, it's expecting something ...
1
vote
1answer
130 views

what is the difference between Drupal.formatPlural() and Drupal.t()?

what is the difference between : Drupal.t(string, arguments, options ) and Drupal.formatPlural() Drupal.t() is used in the javascript part to translate the string and it can accept a set of arguments ...
0
votes
0answers
19 views

Language Hierarchy module bug or is it me?

Not sure if this is the right place to go with this question: However, before I file an issue with this, I'm wondering if it is something I'm missing or doing wrong. The problem. Given a language (...
1
vote
0answers
49 views

How to work with translations on a date?

I am trying to render a translated date coming from an API and I am wondering what's the best way to do it. The value coming from the API is formatted as "February 13, 2007" I would love to ...
0
votes
1answer
24 views

How to autoexpand everything on a view translation edit form?

To fully translate a view into one language I have to expand dozens of collapsed panels, most of them with only one or two subelements. I've reported it here. But is there a quick workaround, like a ...
0
votes
1answer
104 views

How to display the user's preferred language in a User profile page

In a Drupal 8/9 site, I can select the User's preferred language. In the "Manage form display" page (for user's fields), there are two rows which are about language: Language settings (...
-1
votes
1answer
42 views

How do I completely translate a page?

I want to develop a site in two languages. How do I completely translate a page? For example, the menu tab and other places cannot be translated. I just can translate using the Translate tab. In the ...
0
votes
0answers
22 views

How to get the URL component values in the Pager Link display when using Custom URL in Views?

I am trying to add a custom link in the Pager Section in a View that I am buidling in Drupal 8. The link should be dynamic and should be based on the current URL. Views allow you to add a static URL ...
1
vote
1answer
301 views

Translate dynamic variable that is an array in twig or using t()

How do I translate this in twig? I have this variable in twig that is an array: $array = [ ['number' => 7, 'name' => 'foo'], ['number' => 8, 'name' => 'bar'], ['number' => 10, '...
0
votes
0answers
24 views

How can programatically translate an non-English country name to English?

I have a webform hook that processes some conditionals depending on a country name dropdown on the webform. The conditionals need to compare to the English name because there are many various ...
1
vote
1answer
41 views

How do I change the original language of a product type?

On a multilingual site with commerce project I've created a product type while having one language selected as default but now I want to switch it to a different one. On /admin/commerce/config/product-...
2
votes
1answer
65 views

Should I use t() in hook_update_N() or admin UI in a custom module?

Background / motivation Many implementations of hook_update_N() and hook_install() in contrib and core modules in D7 and D8/D9 contain calls to the t() function. In general, I think it is considered a ...
1
vote
1answer
84 views

With Commerce Product taxonomy term view, is there a way to have page title set to the translated term title?

The only way to have the taxonomy term name in the title of a taxonomy term Commerce Products view page I've found so far is the example view in the estore theme (I still don't get how tid which ...
2
votes
2answers
255 views

Translate configuration values in custom webform handler

I created a Custom Webform Handler, which uses the email and name data from the form input to subscribe the user to a newsletter service through the vendors API. Ich created a configuration form with ...
0
votes
0answers
33 views

How translate Config Entity? [duplicate]

Hello everyone how are you? I created a ConfigEntity with some fields: Title (textfield) Body (CKEditor) After that I insert the first item: Title = "Hello World" Body = "This is a ...

1
2 3 4 5
38