Skip to Content Skip to Menu

Problem with CB 1.4 and language

  • yann.fr
  • yann.fr
  • OFFLINE
  • Posts: 33
  • Thanks: 1
  • Karma: 1
13 years 10 months ago #154278 by yann.fr
Problem with CB 1.4 and language was created by yann.fr
With the version 1.4 it may be on the form a message "This field is required."

This message is set in cb.validator.php =
required: "<?php echo addslashes( CBTxt::T("This field is required.") ); ?>"

How to translate such a message ?

Thanks.

Please Log in or Create an account to join the conversation.

  • jojo12
  • jojo12
  • OFFLINE
  • Posts: 957
  • Thanks: 109
  • Karma: 25
13 years 10 months ago #154294 by jojo12
Replied by jojo12 on topic Re: Problem with CB 1.4 and language
why do you go inside, there are extra language files. Or use the files for translating in your language. (I am a normal user, not programmer).
For me the german language files are very good!

Please Log in or Create an account to join the conversation.

  • kakina
  • kakina
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 0
13 years 10 months ago - 13 years 10 months ago #154298 by kakina
Replied by kakina on topic Re: Problem with CB 1.4 and language
cb.validator.php is still hard-coded so the language file will not solve the problem. I think the the team forgot to make it dynamic.


See comments in cb.validator.php

/**
* Form validation support class
* @since 1.4 RC BUT experimentally only: this will become dynamic instead of static
*/
Last edit: 13 years 10 months ago by kakina.

Please Log in or Create an account to join the conversation.

  • beat
  • beat
  • ONLINE
  • Posts: 2174
  • Thanks: 463
  • Karma: 352
13 years 10 months ago #154415 by beat
Replied by beat on topic Re: Problem with CB 1.4 and language
It's translated, but a new string in CB 1.4, needing a CB 1.4 language plugin.

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in or Create an account to join the conversation.

  • numero7
  • numero7
  • OFFLINE
  • Posts: 2
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #163841 by numero7
Replied by numero7 on topic Re: Problem with CB 1.4 and language
Hello same problem for me, I've installed the CB 1.4 french pack but it always state : This field is required.

any idea ?

Please Log in or Create an account to join the conversation.

  • jrariasf
  • jrariasf
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
13 years 7 months ago #163912 by jrariasf
Replied by jrariasf on topic Re: Problem with CB 1.4 and language
There are two files you have to change.
In my case, spanish:
- administrator/components/com_comprofiler/library/cb/cb.validator.php [line 29]
Code:
$.extend(jQuery.validator.messages, { required: "<?php echo addslashes( CBTxt::T("Este campo es obligatorio.") ); ?>", remote: "<?php echo addslashes( CBTxt::T("Por favor, corrija este campo.") ); ?>", email: "<?php echo addslashes( CBTxt::T("Por vafor, introduzca un email válido.") ); ?>", url: "<?php echo addslashes( CBTxt::T("Por favor, introduzca una dirección válida.") ); ?>", date: "<?php echo addslashes( CBTxt::T("Por favor, introduzca una fecha válida.") ); ?>", dateISO: "<?php echo addslashes( CBTxt::T("Por favor, introduzca una fecha (ISO) válida.") ); ?>", number: "<?php echo addslashes( CBTxt::T("Por favor, introduzca un número válido.") ); ?>", digits: "<?php echo addslashes( CBTxt::T("Por favor, introduzca sólo dígitos.") ); ?>", creditcard: "<?php echo addslashes( CBTxt::T("Por favor, introduzca un número de tarjeta de crédito válido.") ); ?>", equalTo: "<?php echo addslashes( CBTxt::T("Por favor, introduzca el mismo valor de nuevo.") ); ?>", accept: "<?php echo addslashes( CBTxt::T("Por favor, introduzca un valor con una extensión válida.") ); ?>", maxlength: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, no introduzca más de {0} caracteres.") ); ?>"), minlength: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, introduzca al menos {0} caracteres.") ); ?>"), rangelength: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, introduzca un valor entre {0} y {1} caracteres de longitud.") ); ?>"), range: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, introduzca un valor entre {0} y {1}.") ); ?>"), max: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, introduzca un valor menos o igual que {0}.") ); ?>"), min: $.validator.format("<?php echo addslashes( CBTxt::T("Por favor, introduzca un valor mayor o igual que {0}.") ); ?>") });

- components/com_comprofiler/plugin/language/spanish/cbteamplugins_language.php: Adding this lines in line 167:
Code:
// CB 1.4 Validations: 'No changes.' => 'Sin cambios.', 'This field is required.' => 'Este campo es obligatorio.', 'Please fix this field.' => 'Por favor, corrija este campo.', 'Please enter a valid email address.' => 'Por vafor, introduzca un email válido.', 'Please enter a valid URL.' => 'Por favor, introduzca una dirección válida.', 'Please enter a valid date.' => 'Por favor, introduzca una fecha válida.', 'Please enter a valid date (ISO).' => 'Por favor, introduzca una fecha (ISO) válida.', 'Please enter a valid number.' => 'Por favor, introduzca un número válido.', 'Please enter only digits.' => 'Por favor, introduzca sólo dígitos.', 'Please enter a valid credit card number.' => 'Por favor, introduzca un número de tarjeta de crédito válido.', 'Please enter the same value again.' => 'Por favor, introduzca el mismo valor de nuevo.', 'Please enter a value with a valid extension.' => 'Por favor, introduzca un valor con una extensión válida.', 'Please enter no more than {0} characters.' => 'Por favor, no introduzca más de {0} caracteres.', 'Please enter at least {0} characters.' => 'Por favor, introduzca al menos {0} caracteres.', 'Please enter a value between {0} and {1} characters long.' => 'Por favor, introduzca un valor entre {0} y {1} caracteres de longitud.', 'Please enter a value between {0} and {1}.' => 'Por favor, introduzca un valor entre {0} y {1}.', 'Please enter a value less than or equal to {0}.' => 'Por favor, introduzca un valor menos o igual que {0}.', 'Please enter a value greater than or equal to {0}.' => 'Por favor, introduzca un valor mayor o igual que {0}.'

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum