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
-3
votes
1answer
101 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
1answer
192 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
1answer
280 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
1answer
117 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
0answers
152 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
3answers
995 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
1answer
239 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
3answers
844 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
0answers
147 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
1answer
522 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
2answers
982 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
1answer
80 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
4answers
340 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
0answers
100 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
1answer
61 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
1answer
139 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 ...
2
votes
1answer
38 views

Display block content in current language

I have multilingual Drupal 8 site. I want to display views block in home page. It should display block contents in current site language. Example: I have content type called "Book". Which has ...
1
vote
0answers
45 views

How can I build a blog in a single language that isn't English?

I am developing my new blog based on Drupal 8 and I want only Greek version of the blog (don't want content translation). I added Greek language as default and if there is also English then there is a ...
1
vote
2answers
252 views

How to sort language select list on current language context

I have a form with a language field with the language select list widget. The options of this field contains an array with a pattern like ['langcode' => t('language')] Now I want to sort these ...
2
votes
1answer
53 views

String passed to the T function in inline_template not accessible for translation

For a custom field I have a formatter: public function viewElements(FieldItemListInterface $items, $langcode) { $elements = []; foreach ($items as $delta => $item) { $value = ...
0
votes
1answer
52 views

Unable to override default translation publishing status using entity_translation module

We are using the entity_translation module in a large site, and we have 57 defined languages. We have some custom date fields in each locale, and we are using some custom code to only publish the ...
0
votes
1answer
139 views

Custom entity translation interface

I created a new custom entity using drupal console, I enabled translation and all looks ok in code. The problem is that I don't know how to translate an entity from the admin interface, I don't see ...
0
votes
2answers
437 views

Multiple Relations and Contextual Filters in a Translated View

I have a View designed to filter down translated content (of type "Asks, Actions, and Updates") using three arguments: 1) country 2) year 3) month. I have translated the content type and content, all ...
-1
votes
1answer
18 views

User should not be allowed to edit language

I have a question regarding this. I have a Multilingual site in drupal 8 and i want to disable the edit language for user, so they can´t change the language, if they have chosen one or redirect them, ...
2
votes
1answer
2k views

How do I remove the language_content_entity query from the canonical URL?

Following the Translating content documentation we have setup our site to have Spanish, English, and Japanese. When we are adding, editing, deleting, and publishing pages in different languages we ...
1
vote
1answer
901 views

Translatable strings not appearing in the translation interface [duplicate]

I've recently started working on a custom D8 module. I've used $this->t() (or t()) wherever I had to output a text so that this text would then be translatable. My module works correctly, but when ...
0
votes
2answers
337 views

Translations string email not work

in D8 (multilanguage site, with two languages) i wanna send email for registration, etc by user preference of language of user (People -> Edit people -> Language Settings) I've enabled all modules ...
0
votes
1answer
226 views

Deleting translate interface strings programmatically or using drush

I need to delete some translated strings added using t() function, I've about 17000 string to delete is there a way to delete it using a SQL query or drush command? in which table those strings are ...
0
votes
1answer
27 views

Attempt URL alias for spanish version of page - “The path */* is either invalid or you do not have access to it.”

Drupal 7.59. We have the page whatever.tld/thanks and whatever.tld/es/thanks. I'm trying to setup whatver.tlp/gracias as a URL alias for es/thanks and it says "The path 'es/thanks' is either invalid ...
1
vote
3answers
613 views

Managing custom theme translations file

How to add a translation file to a custom theme? I did my_theme.info.yml 'interface translation project': my_theme 'interface translation server pattern': themes/my_theme/translations/my_theme-%...
0
votes
2answers
48 views

Available node language only English

I have a custom content type with "Set custom language as default for new content" and "Require language". Custom default language is Current language. Entity translation is defined with "Current ...
1
vote
1answer
33 views

Convert imported strings into array

I have imported a .pot file using the _locale_import_read_po function, like this: $po_files = file_scan_directory('/', '/.*\.pot$/'); if (count($po_files)) { require_once DRUPAL_ROOT . '/includes/...
2
votes
2answers
165 views

Convert pot file to array

So, what I need to do is to convert the contents of a .pot file to an array. I know there is _locale_import_read_po(), but when I tried using it with the following code, I got an error. $...
2
votes
1answer
678 views

EntityQuery not returning content based on language

I'm trying to get a list of all of a specific content type, but my entityQuery is only returning the original language of the site (English). Here's my code: public function ...
0
votes
2answers
187 views

What message is throwing InvalidArgumentException(s) in my contact forms?

When submitting a contact form it redirects to a WSOD and this is logged: Uncaught PHP Exception InvalidArgumentException: "$string ("Message") must be a string." at /Applications/MAMP/htdocs/onb/...
0
votes
1answer
26 views

Display node with mixed languages

My nodes, with entity translation enabled, need to be able to handle a node where the content of the node is displayed differently regarding the labels and menus. Let's say I am on a french page, ...
2
votes
3answers
358 views

Add Language Switcher on admin toolbar

What is the correct way for adding Language Switcher (Dropdown) or links on the admin toolbar menu from my custom module or from a contributed module?
3
votes
1answer
203 views

Interface translation conflict / same EN word, different translations

I've created a custom module, that uses templates with hard coded strings. I've created the .pot and .po files and included them my module's YML file. The Twig tempatles translate those strings using ...
2
votes
4answers
476 views

Dynamic language negotiation by multiple top level domains

I am porting www.example.com, the German version is at de.example.com, the French is at fr.example.com and so forth. I could enter these domains in admin/config/regional/language/detection/url but I ...
0
votes
1answer
212 views

Show English when there is no translation

I have a website for a client, with more than 5 languages (bg, en, ru, ch, de, it ...). The client wants to add a news section but the news should be only in en or ch and if the user selects a ...
3
votes
1answer
771 views

Create translated node programmatically

I need to recreate the behavior drupal has when you create a translation but programmatically. Doing $node->addTranslation('de'); on a hook insert create an empty node but I need the field to be ...
0
votes
1answer
981 views

How to render a paragraph field in Twig in correct language?

I've got nodes with hero images. The hero images are a paragraph field with unlimited cardinality, each with an image and a translatable text. For design reasons I need to print the hero images in ...
0
votes
1answer
303 views

drush import export drupal configuration and translations

I downloaded the .po file for loading the Italian language and installed it on my local version of Drupal. Then, I launched the config:export command with drush and I committed the created ...
0
votes
2answers
385 views

Programatically set the language

I'm trying to automate the setup of Drupal multi-site installations as much as possible, we're using each multi-site for a separate country so would like the languages localised for each. Is there a ...
0
votes
1answer
54 views

how to optimize setting theme suggestion for different languages?

I've been trying to look for a way on how to optimize theme suggestions for different languages. The code below is a snippet of what I have been working on. One is for english and one is for Spanish. ...
0
votes
1answer
908 views

Export custom module strings for translation

I've developed some custom modules for a client and implemented the $this->t() method to enable translations on static strings, like table headers. Is there a way to export only the translatable ...
0
votes
1answer
235 views

Error in Italian localization for datepicker

Well, this is very funny :) I have a datepicker localized in Italian. It works correctly, except that, apparently, the abbreviation for Wednesday was translated as it were a personal pronoun, since ...
1
vote
1answer
81 views

Translation has duplicate admin content listings

When I add a language translate option to a piece of content for French. Drupal now adds a second listing of that piece of content in the content admin view. Is this the expected behavior? What if ...
3
votes
1answer
136 views

Only render translated nodes, prevent rendering of base language node

Having an entity reference, Drupal 8 automatically renders the base language of a referenced entity if it isn't translated yet. Is there a way to globally prevent that? So if there is ContentType1 ...
0
votes
1answer
48 views

Language switcher block hides for authenticated user

I have a language switcher added to my site. It works fine as long as I'm an unauthenticated user. Logging into site replaces it with: <span data-big-pipe-placeholder-id="callback=Drupal%5Cblock%...

1 2 3
4
5
37