Questions tagged [i18n-l10n]
Use it in questions about adapting software to different languages, regional differences, and requirements of a target market (locale).
1,907
questions
1
vote
0
answers
10
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
0
answers
145
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
0
answers
42
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
1
answer
15
views
Is Entity Translation module compatible with Internationalization and can they be used to translate menus?
I installed the 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 ...
1
vote
1
answer
51
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
1
answer
2k
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
0
answers
98
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
0
answers
135
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 ...
2
votes
0
answers
2k
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 ...
5
votes
2
answers
711
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
1
answer
297
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
0
answers
42
views
As a module developer, how do I handle outputting user defined strings with regards to translatability? [duplicate]
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
1
answer
85
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 ...
2
votes
1
answer
2k
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
0
answers
126
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
1
answer
103
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
1
answer
152
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
1
answer
169
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 ...
2
votes
0
answers
726
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
1
answer
58
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
2
answers
2k
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 ...
1
vote
1
answer
210
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
2
answers
139
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 ...
-2
votes
1
answer
73
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
0
answers
1k
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
1
answer
86
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 ...
0
votes
0
answers
1k
views
How can I render the output in a certain language in a Twig template? [duplicate]
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
1
answer
396
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 ...
0
votes
1
answer
35
views
Language pages are triplicated
Our website was developed with Drupal and we only have a small set of Spanish language pages on a primarily English website.
My question is, I'm getting THREE pages generated for every one page:
....
1
vote
0
answers
39
views
How to export the translation of a vocabulary?
I have 2 vocabularies. Vocabulary 1 and Vocabulary 2.
Vocabulary 1 is exported in feature test_feature1 and Vocabulary 2 is exported in test_feature2.
My site is multilingual. I want to export the ...
2
votes
2
answers
232
views
How to translate Groups in a multilingual site?
I have created a new grouptype and added some fields to have a "site". And then created a new group with this grouptype. I edited the overview site with some information. Now I would like to translate ...
1
vote
1
answer
417
views
How to use language-specific menu items in URL aliases
I'm working on a site with internationalization from the source language, English, into a few other languages. Translating the pages has worked out fine; however, I'm running into trouble with URL ...
0
votes
1
answer
338
views
How to get language code of a field in a node
I have a requirement where in hook_node_insert I need to get the language code of a field
What I have tried is
$langcode = $node->{$field_name}->langcode
But this returns null. Any ...
3
votes
1
answer
361
views
robots.txt vs language path prefix
The default robots.txt shipped with Drupal contains rules such as this:
Disallow: /user/register/
If I understand correctly, the leading slash means this really has to match the beginning of the ...
-3
votes
1
answer
298
views
Language switcher doesn't work
I have a fresh D8.64+Bootstrap 3 installation, after enable multilingual modules, add languages and config language dection and content/menu translation, I placed the defualt language switcher to the ...
2
votes
1
answer
396
views
Language switcher links are hidden for anonymous users
I'm trying to add a language switcher to a Drupal 8 site menu (it's switching between English and Spanish). I have the links working when logged in as admin but they're not shown for anonymous users, ...
0
votes
1
answer
729
views
InvalidArgumentException: Invalid translation language (fr) specified
I'm currently trying to translate my twig template to the current language and at this moment I'm getting the following error
InvalidArgumentException: Invalid translation language (fr) specified.
...
1
vote
1
answer
254
views
Error: Call to undefined function locale_translation_use_remote_source() in install_import_translations()
After I added a language, and set as default language, I get this error.
Error: Call to undefined function locale_translation_use_remote_source() in install_import_translations()
I didn't enable ...
1
vote
0
answers
376
views
entityQuery where a translation with a different value returns incorrect nodes
The title seems a bit odd, I know, but I couldn't find any issues similar to this and that's the best I could come up with. We are running into an odd instance of entityQuery returning nodes that ...
3
votes
3
answers
2k
views
How to get the language code when a language name is given?
We are creating nodes programmatically on submitting a form. The language of a node is an input value in the form.
How can I get the langcode, when I have the Language name?
For example, user may ...
2
votes
1
answer
373
views
main menu link as language switcher
I have 2 language and these situation:
main menu -> lang1 -> link to www.foo.com/
main menu -> lang2 -> link to www.foo.com/en
All sites when switch manually on browser the language, But my main ...
5
votes
3
answers
1k
views
View display plugin "entity reference" not using translation
UPDATE: This bug was just fixed in Issue
2174633 and
Drupal v8.7.9 will no longer have this problem.
For some of my entity reference fields I'm using "Views: Filter by an entity reference views" ...
0
votes
0
answers
208
views
Remove string from [node:url] and node alias
Background
We have enabled content translation where we detect based on the content language. This allows us to translate properly as needed, but it has a bad side effect.
It will not only add ?...
2
votes
1
answer
1k
views
Automatically importing module-provided translations during installation
I have a custom module whose interface strings have all been written in English. This module is not (and will not be) hosted on drupal.org, so I'd like to pack the translations for those texts ...
1
vote
2
answers
2k
views
How can I allow HTML links in translated strings?
I created a custom D8 module with all text strings declared in English, either via this->t(), t() or in various configuration (YML) files.
I am now in the process of translating those strings in ...
1
vote
1
answer
95
views
Show content that is tagged to both current node and translation source
I'm using Drupal 7, i18n, Views3, translated_entityreference, and Entity Translation.
http://lingtransoft.info/apps/paratext
I have a content type: Training Resource, and each Training Resource is ...
4
votes
4
answers
504
views
How to clone a node without translations
I have a site with multiple language. Assume I have a node (nid = 1) with origin languages is en and translate to es. And I clone this node with code:
$node = Node::load(1);
$nodeDuplicate = $node-&...
0
votes
0
answers
244
views
View results to show results in language of current page, but if no translation available show original language?
I need a view to display results based on the following:
if the content has a translation available in the language of the current page, show that one
if the content DOES NOT have a translation ...
1
vote
1
answer
134
views
How to get term ID from translated term name?
I have a custom argument validator for Views, which expects a term name input and outputs the tid for the query. This works great in English, but I'm not sure what to do for translations. Is there any ...
1
vote
1
answer
301
views
How do I create a multilingual export?
I have Drupal 8 site which interacts with a React component.
I want to expose one of my content type's content using REST export in views.
How do I set views path to create REST export for ...