In D7 I sometimes found use for the stringoverrides module to replace certain text strings, such as that shown in a status message.

Specifically, I want to alter the error message "The name xxxxxxx is already taken." when a new user registers and replace it with "The name xxxxxxx is already taken. Please choose another username."

What would be the most effective and simple way to make this change in BackdropCMS?

Thanks,

Martin

Accepted answer

First, I wouldn't call it "doing something wrong" but maybe not knowing a strange  behavior of the translation system: It happens that after enabling Locale and Language, the string in question has to be used  by the system at least once, so that the translation system is aware of it.

To find the missing string in the translation interface, enable User registration, try to register with an existing name, and look for the message "The name %name is already taken.". After that, the string should be available in the translation interface.

Comments

Olafski's picture

The user interface translation allows to 'translate' the interface from English to English, making it possible to replace individual language strings. I was able to do so following these steps:

  • Enable the core modules Language and Locale.
  • Go to Configuration > Regional and language > Languages.
  • Configure English, tick the option "Enable interface translation to English", and save the configuration.
  • Go to Configuration > Regional and language > Languages > User interface translation, search for the string "The name %name is already taken.", and 'translate' it with the string of your choice.
     

Thanks for that suggestion @Olafski. However, when I follow your instructions and go to  Configuration > Regional and language > User interface translation (at admin/config/regional/translate) and search for any part of "The name %name is already taken." it returns no matches. 

Any idea what am I doing wrong?

 

Olafski's picture

First, I wouldn't call it "doing something wrong" but maybe not knowing a strange  behavior of the translation system: It happens that after enabling Locale and Language, the string in question has to be used  by the system at least once, so that the translation system is aware of it.

To find the missing string in the translation interface, enable User registration, try to register with an existing name, and look for the message "The name %name is already taken.". After that, the string should be available in the translation interface.

I didn't realise that - now working perfectly. Thanks for your help Olafski!