Problem / Motivation

The Messages should be translatable in the backend.

Solution

Change the type of the messages in the schema file to text (translatable).

CommentFileSizeAuthor
#2 3061792-1-schema-fix.patch2.62 KBsiegrist
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Siegrist created an issue. See original summary.

siegrist’s picture

StatusFileSize
new2.62 KB

I created a patch changing the field types in the schema file and adding some task links to let the translate tab show up in the form.

siegrist’s picture

Status: Active » Needs review
anybody’s picture

Status: Needs review » Needs work

Just ran into this. We'll provide a MR. "text" should only be used for texts, not for (<=255 chars) strings. Use label instead.

Having a look at the configuration page admin/config/people/login_security not all of these values are long texts.

anybody’s picture

Title: Multilingual » Configuration strings are not translatable
Category: Feature request » Bug report

Grevil made their first commit to this issue’s fork.

grevil’s picture

Version: 8.x-1.x-dev » 2.x-dev

grevil’s picture

WIP.

anybody’s picture

@Grevil: I just changed the both text to label which are one-liners.

The last part should be to add this:

diff --git a/login_security.config_translation.yml b/login_security.config_translation.yml
new file mode 100644
index 0000000..d5bf8b1
--- /dev/null
+++ b/login_security.config_translation.yml
@@ -0,0 +1,5 @@
+login_security.settings:
+  title: 'Login security settings'
+  base_route_name: login_security.settings
+  names:
+    - login_security.settings
\ No newline at end of file
diff --git a/login_security.links.task.yml b/login_security.links.task.yml
new file mode 100644
index 0000000..59f151d
--- /dev/null
+++ b/login_security.links.task.yml
@@ -0,0 +1,4 @@
+login_security.settings_translate:
+  title: 'Login Security settings'
+  route_name: login_security.settings
+  base_route: login_security.settings
-- 

Unsure why you especially removed login_security.config_translation.yml which I thought was needed for grouping the translations for this page: admin/config/regional/config-translation but I might be wrong.

login_security.links.task.yml also makes sense in my eyes to add the translate link on top of the configuration page.

See this: https://github.com/VITObelgium/drupal-boilerplate/tree/master/config_tra...
Which I guess is correct.

Let's talk if you're unsure here.

grevil’s picture

Yea my bad, never seen it before, so I wanted to test it without the yml first and commited the yml removal, sry!

grevil’s picture

Status: Needs work » Needs review

All done!

anybody’s picture

Status: Needs review » Reviewed & tested by the community

Super nice @Grevil and @Siegrist!

RTBC!

grevil’s picture

Just checked the translation page and I get the following notice:

Deprecated function: rawurlencode(): Passing null to parameter #1 ($string) of type string is deprecated in etracker_page_attachments_alter() (line 200 of modules/custom/etracker/etracker.module).

But this is generally a problem of this module, as it rarely uses fallbacks and empty checks for passed variables, leading to a bunch of deprecation errors with php > 8

Everything else works as expected, so RTBC +1!

  • Anybody committed 8404428a on 2.x authored by Grevil
    Issue #3061792 by Siegrist: Configuration strings are not translatable
    
anybody’s picture

Status: Reviewed & tested by the community » Fixed

Merged! Will be part of 2.1.0!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.