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

How can I purge unused translatable strings from the translation interface?

During the development, the wording changed quite a lot. When I generate translation jobs with tmgmt module (or by any other means), all the old wordings are listed as well. Is it possible to have a ...
1
vote
3answers
80 views

Can I translate nodes and provide access to their translated content without the use of a site-wide language switcher?

Intended behaviour / question Writer creates /node/5001 Translator translates /node/5001 to french using all the niceties of the Content Translation backend system Visitor goes to /node/5001 and sees ...
0
votes
0answers
10 views

How to filter GraphQL query by content language?

I am coding Drupal 8/Angular app and Angular is fetching data from Drupal using GraphQL. Everything works fine except now I need to query nodes in a particular language. This is my query: { ...
-2
votes
0answers
11 views

Translate “All” for isotope filter [on hold]

Am translating a Drupal 7 website to Japanese. I was able to translate all sections but am failing to translate the "All" filter of the Isotope filter. Please help.
0
votes
1answer
18 views

How to set “Language Selector dropdown” required in node form

I want to know How to set "Language Selector Drop-Down " required in node form? I tried to do this via hook_form_alter, but it seems $form['language'] is not created in this hook ! Is there any hook ...
0
votes
1answer
22 views

Node access doesn't consider translation

I'm trying to check user access to node via this code: $node = Node::load($node_id); User::load(\Drupal::currentUser()->id()); $node->access('view', $account) It seems it doesn't check ...
2
votes
1answer
36 views

How to get translated field_storage_config

I need to programmatically set the translated values for several fields on a node. For that I would like to set their values in the fields field_storage_config. Adapted from another question's answer (...
-2
votes
1answer
28 views

Getting translated version of Menu

I'm trying to get translated variant of Manu, but I can't make it work. This is code of what I'm trying to do, but this is for content node. $entitytype_manager = \Drupal::service('entity_type....
0
votes
1answer
19 views

Assign different taxonomy terms to translations of content

I've got some custom content translated with entity translation with custom taxonomy also translated. Actually taxonomy terms are correctly shown inside the content page. The problem is I need ...
0
votes
0answers
30 views

Get Translated Config

I've followed a few tutorials on how to set up a custom settings form and create translations. All this seems to work, but after adding a translation, I am unable to get the config settings for that ...
0
votes
0answers
17 views

Front page per language (paragraphs) [duplicate]

I have a multilingual site in Drupal 8 that needs to have a different node for front page on each language. The node alias is homepage and it needs to look clean. Ex. site.com/us/ site.com/ca-fr/ ...
0
votes
0answers
47 views

Custom LanguageNegotiator not working on interface translations

In a custom module I created a custom admin route /admin/config/mymodule/rebuild whose controller renders a node into a variable. The purpose of the module is to send the rendered content to an ...
0
votes
1answer
19 views

Unable to access translated node content

After performing a Drupal core update on my site today I've found that I can no longer access translated content. When I try to view or edit the translation, I only see the default language content. ...
1
vote
1answer
18 views

Use hook to get the domain configuration from language

We have enabled English, Spanish, and French on our site. On Regional and language >> Languages detection we selected URL for Content language detection >> Detection Method. For Part of the URL that ...
0
votes
1answer
43 views

How to use t() function in controller?

I understand Drupal 8 ControllerBase implements StringTranslationTrait so we can use $this->t() in Controller class. But I found in Drupal 8 examples code, they setStringTranslation to use t() ...
0
votes
1answer
34 views

Not able to enable 'Configuration Translation' module gives error

I am trying to enable MULTILINGUAL -> Configuration Translation. It gives below error. Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->...
0
votes
0answers
19 views

Taxonomy terms not localized in view with enabled aggregation

On a view on content, I added a field "All taxonomy terms" (Display all taxonomy terms associated with a node from specified vocabularies) and enabled aggregation, see screenshot of view attached. ...
1
vote
0answers
9 views

Make interface strings configurable per language, identified by machine name

We are building a complex page layout where some labels should be not only translatable, but configurable per language, including English. The display logic is already custom code, so we are quite ...
0
votes
0answers
30 views

Exporting content translation to similar server

I have 2 instances of the same site built using Drupal. Both need to be translated, and most of the work of the translation has been done on site A and we need to take the translations from site A to ...
0
votes
0answers
31 views

Custom module translations without interface translation

I'm trying to figure out if I can provide translations to my custom module that are considered part of the "content translation" rather than the "interface translation." I have a form in my module ...
0
votes
0answers
6 views

Is Entity Translation module for Drupal 7 compatible with Internationalization and can they be used to translate menus?

I installed entity translation module for Drupal 7 and it works fine. However, I also want to translate menus and I found that Internationalization module can do that. The question is: are they ...
0
votes
0answers
12 views

D8 multi-language: How do I force the default path (/) for non-translated content after visiting translated content (/es/)?

I have a Drupal 8 site with two languages, English (default language) and Spanish. English (default) is at / and Spanish is at /es/ via the url detection rule and that rule is on top and the only ...
0
votes
0answers
22 views

Notice: Undefined property: stdClass::$domain in locale_language_url_rewrite_url()

I have a bilingual website set as two different subdomains (fr.domain.com and en.domain.com) and a custom module for content-aware language switcher link in the main menu (i.e. if I'm on fr.domain.com/...
1
vote
1answer
41 views

Running functional tests on a non-English site

When creating functional tests (extending BrowserTestBase) for a D8 site, how would I go about changing the default language of the site being temporarily created by BrowserTestBase? I'm trying to ...
0
votes
1answer
106 views

Generating URLs with fromUri and the language prefix, base vs internal

What is the recommended way to generate non-route URLs that include the language prefix? Context: In CiviCRM, an open source third-party project that integrates with Drupal, we have a function that ...
1
vote
0answers
27 views

EntityFieldQuery: Filter by field language

How would I use EntityFieldQuery->fieldCondition() or similar to filter by field language? E.g. give me all nodes where field_description has items in English, or in LANGUAGE_NONE? There is a $...
0
votes
0answers
30 views

Translate a taxonomy term in the exposed filter select options

I'm using Drupal 8 with Better Exposed Filters and for some reason the select options in the exposed filters (which are taxonomy terms) are refusing to appear translated, despite the fact that the ...
1
vote
0answers
136 views

How do I remove unwanted hreflang links from page

I have a content page in English with Japanese and Chinese translations. Even when I unpublished the translation nodes, the page source code will display the hreflang attributes to the unpublished ...
0
votes
0answers
25 views

Drupal 8 webform translated. Webform-block on page selected/listed not showing up (where is the manual)?

Drupal 8! Webform module! I have made a drupal webform and added it to my webpage with creating a block. The block is restricted to the page by url. Everything worked well with this method. With ...
3
votes
2answers
142 views

I cannot translate the action label

I'm using Umami profile and choose Spanish is default language. Almost of the interface has been translated into Spanish. But some places did not translate like user page. I'm going to admin/config/...
0
votes
1answer
37 views

How to use Interface Translation for specific text on specific pages only

I need to translate certain text in a twig template to one of several languages, depending on the Language selected for the node being displayed. I've installed the Interface Translation module (...
0
votes
0answers
39 views

As a module developer, how do I handle outputting user defined strings with regards to translatability?

A module I maintain is introducing the ability to customize some messaging that is output to users on the site. Up until now, that messaging has been hard-coded and output using the TranslatableMarkup ...
0
votes
1answer
26 views

Render a menu block in current user's language

I have a multi-language site. How this is supposed to work is that on /fr pages, everything except main navigation block should be in French. However, main navigation menu block should be in whatever ...
0
votes
0answers
22 views

Use Drupal languageManager() to Get Unicode v11 Language Names?

Is there any way to get Unicode v11 supported script names from Drupal data? I would like to use '~@(\p{Language}+)~u', but Drupal provides different language names such as "Russian" and "Mongolian" ...
0
votes
1answer
84 views

How do I programmatically set the preferred language for a user?

I would like to update the preferred_langcode of a user as soon as he changes the language in a language switcher block. I'm already aware of the getPreferredLangcode method mentioned in https://api....
0
votes
0answers
78 views

Why is a ISO:8601 date within a time tag converted to zeroes?

I've been attaching Timeago script to my themes and it requires dates to be formatted like this. <time class="timeago" datetime="2008-07-17T09:24:17Z">July 17, 2008</time> In a view, I ...
0
votes
1answer
84 views

Translating a taxonomy term does not populate content into fields

When translating a node into another language it does the following: automatically populates all fields with content from the source node on the edit form ensures the two nodes are linked as ...
0
votes
0answers
20 views

Configuration translate Form Access Denied

This questions has repeat several times, but I face similar issues. Here are configuration yml information webform_protected_downloads.configsettings.yml token_text: 'test' langcode: en ...
0
votes
1answer
58 views

“Language neutral” is not available for content

On a standard multilingual Drupal installation (Drupal 8.6.10), when editing existing content or creating new content the option language neutral isn't available; only the enabled languages and some ...
3
votes
1answer
67 views

Check if translation is new

I am working on a module that needs to send push notification through FCM, I use Firebase Push Notification (FCM) for this purpose and it works well. So what I need to do is to send a push ...
1
vote
0answers
94 views

How a media image entity_reference field in a custom content entity can be set to translatable?

I created a media image field in my custom entity content: $fields['image'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Promotion image')) ->setDescription(t('...
0
votes
1answer
31 views

Cannot create custom translated path alias for /user/login

I cannot create a path alias for spanish translation. When I try to create, it says Route is invalid or you don't have access Saw this but it doesn't have an answer: https://www.drupal.org/project/...
2
votes
2answers
184 views

How to bulk delete translation strings

I imported some translations using the locale update module but the translations are horrible and it would be better to revert to English. How do I bulk delete all the imported translations in Drupal ...
0
votes
1answer
51 views

When translating a node, can I avoid copying the default value from the original language

Just a little background: I've got a set of paragraphs fields that I need to be able to translate, and given the limitations on translation with paragraphs, I've come up with the idea, that it may ...
0
votes
2answers
30 views

Best way to place hard coded link in template in multi lingual drupal 8

My website (drupal 8) was first in one language. Now I switched to multi langual. Most of the settings i did find (translate content, webforms, strings,...). But at the moment stuck on the hard ...
-3
votes
1answer
29 views

Help with user interface translation

Our portals are using User Interface Translation to do the translations. These copies/texts are located in the front-end as part of the content, or sometimes are pop ups. This tool is not translating....
2
votes
0answers
134 views

How do I programmatically change the node default language?

I have a node already translated in 3 languages (en, fr, es) with en being the default language. and I want to change it to fr. I looked around and I found setDefaultLangcode() (protected). Is there ...
0
votes
1answer
23 views

drush language importing untranslated strings

I am having 2 environments. A staging and a production one. I want all string to sync the strings, so that whenever a new string comes to staging it is available for translation in production. For ...
1
vote
0answers
62 views

How can I render the output in a certain language in a Twig template?

I am trying to override the titles of the nodes on my view page for Drupal 8. As my whole website is in English, but only on one view page I need to fetch the french translation of the titles, without ...
0
votes
1answer
46 views

How to alter a link of the language switcher? [duplicate]

I would like to alter the link displayed on the language switcher for the second language of my site, for a certain node. Essentially when you viewing a certain node in the main language, and then use ...