Author Topic: Where are the texts for the language $oTrans?  (Read 158 times)

Offline Vasiliy

  • Posts: 35
  • Gender: Male
Where are the texts for the language $oTrans?
« on: September 25, 2018, 10:55:21 AM »
Hello!

I want to change the texts of messages for my language. I can not find where they are hidden.
For example, change the text:$oTrans->MESSAGE_USERS_NAME_ INVALID_CHARS
Or
$oTrans->MESSAGE_SIGNUP_NO_E MAIL

Best regards,
Vasiliy

Offline hgs

  • Betatester
  • **
  • Posts: 920
    • EFG MG
Re: Where are the texts for the language $oTrans?
« Reply #1 on: September 25, 2018, 11:25:47 AM »
I used google translate for the translation

If I understood correctly, you are looking for the language files of modules. Correct?
These are in each module the WB with supplies in a subdirectory / languages /
There are files according to the pattern EN.php for English or DE.php for German.

Here is an excerpt of the files EN.php and DE.php
EN.php
Code: [Select]
//Variables for the  backend
$MOD_FORM['SETTINGS']              = 'Form Settings';
$MOD_FORM['CONFIRM']               = 'Confirmation';
$MOD_FORM['SUBMIT_FORM']           = 'Submit';
$MOD_FORM['EMAIL_SUBJECT']         = 'You have received a form via {{WEBSITE_TITLE}}';
$MOD_FORM['SUCCESS_EMAIL_SUBJECT'] = 'Your form has been submitted to {{WEBSITE_TITLE}}';

DE.php
Code: [Select]
//Variablen fuer backend Texte
$MOD_FORM['SETTINGS'] = 'Formular Einstellungen';
$MOD_FORM['CONFIRM'] = 'Bestätigung';
$MOD_FORM['SUBMIT_FORM'] = 'Absenden';
$MOD_FORM['EMAIL_SUBJECT'] = 'Sie haben eine Nachricht über {{WEBSITE_TITLE}} erhalten';
$MOD_FORM['SUCCESS_EMAIL_SUBJECT'] = 'Sie haben ein Forumlar über {{WEBSITE_TITLE}} gesendet';

For your language you can then adapt the translation or create a new file for your language.
LG Harald

"Fange nie an, aufzuhören - höre nie auf, anzufangen." Marcus Tullius Cicero (106-43 v.Chr.)

Offline Vasiliy

  • Posts: 35
  • Gender: Male
Re: Where are the texts for the language $oTrans?
« Reply #2 on: September 25, 2018, 11:54:17 AM »
Thnk you, for quik unswer.

I downloaded the new version WebsiteBaker and started to do the site.
Immediately I ran into a problem when registering.
I use the Russian language. The default language was Russian. All is written in Russian and only error messages are written in English.
When registering, all error messages are displayed in English only.
I open file signup2.php
In the old version 8.0
$wb->print_error($MESSAGE['USERS']['NO_GROUP'], $js_back, false);
There is a variable MESSAGE['USERS']['NO_GROUP'] and it is in the language file RU.php

In the new version in the file signup2.php
$error[] = $oTrans->MESSAGE_USERS_USERN AME_TAKEN."\n";
I can not find where tofound this variable?
In file RU.php I am found only veriable $MESSAGE['USERS_USERNAME_TAKE N']
but it is written in Russian.
Where to search for a variable <MESSAGE_USERS_USERN AME_TAKEN> to fix?


Offline jacobi22

  • Posts: 5201
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Where are the texts for the language $oTrans?
« Reply #3 on: September 25, 2018, 11:58:40 AM »
give me a minute please for an answer - thx
Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline Vasiliy

  • Posts: 35
  • Gender: Male
Re: Where are the texts for the language $oTrans?
« Reply #4 on: September 25, 2018, 11:59:57 AM »
and so on all variables:
MESSAGE_USERS_NAME_ INVALID_CHARS
MESSAGE_SIGNUP_NO_E MAIL

Offline jacobi22

  • Posts: 5201
  • Gender: Male
  • Support also via PM or EMail
    • Jacobi22
Re: Where are the texts for the language $oTrans?
« Reply #5 on: September 25, 2018, 12:21:24 PM »
a little more detail about this

wb has 3 "groups" for the language
1. - the big language files in folder /language
2. - the language files in some admin-addons like admin/groups or admin/media or admin/users (EN and DE)
3. - the language files in the modules

#1 and #2 and some of the newer modules using the translation class. target is here: using on every page in the backend only a small language file from the cache and not everywhere the whole files, but this job is a job for the future and WB go'es step by step here. in the first step, WB add the Class Translate and some small language file on special places

to your example
$oTrans->MESSAGE_USERS_NAME_ INVALID_CHARS  is the cache-result from this language variable here ->

$MESSAGE['USERS_NAME_INVALID_CHARS'] = 'Invalid characters were used for login names';

red color is the part for the cache-variable
green is the name of the array
blue is the name for the array key

to change one of this variables, you have to know, where it come from. use a global search over all wb-files and search for the blue marked part like USERS_NAME_INVALID_CHARS or SIGNUP_NO_E MAIL

in this special case, both variables are part of the files admin/users/language/EN.php and admin/users/language/DE.php

to have it in your own language, make a copy of the file admin/users/language/EN.php, rename it to RU.php - important is here the correct language code, it must be equal to the favorite language file in the folder /languages
Dont change the original EN.php maybe to russian or other languages, use only the language for this language file there (english for EN.php, german for DE.php, russian for RU.php etc)

now translate everything in this file to your favorite language. if you're finish, go to the WB-Info-Window in the top-menu (i-Button) search there for a link called "Clear Translate Cache" (nearly to the bottom), click on this link and wait for a success message. After that, you can use the russian language file in back- and frontend, if this language selected as page language btw as user-language.

important: try your frontend also, when you logged out from the WB-Backend


Probleme sind da, um sie zu lösen, nicht, um nach Ausreden zu suchen.

Offline Vasiliy

  • Posts: 35
  • Gender: Male
Re: Where are the texts for the language $oTrans?
« Reply #6 on: September 25, 2018, 01:44:33 PM »
Thank you.

 

postern-length