jshuter / php-form-builder-class

Automatically exported from code.google.com/p/php-form-builder-class
GNU General Public License v3.0
0 stars 0 forks source link

Multilanguage Replies #16

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice to have the replies
in different languages.

Maybe at the beginning a command like this:
$form->setLanguage("german")

Or a cvs file to load
$form->setLanguage("mylanguage.csv")

"submit";"Senden"
" is a required field.";" ist ein Pflichtfeld."
"The CAPTCHA solution was incorrect.";"Die CAPTCHA Eingabe ist falsch"
"We weren't able to verify the public key.";"Der öffentliche Schlüssel
konnte nicht verfiziert werden"

Original issue reported on code.google.com by bernhard...@gmail.com on 10 Feb 2010 at 4:04

GoogleCodeExporter commented 8 years ago
Bernhard,

Thanks for your feedback and support of this project.  I agree with you, 
language
translation would be a nice addition.  I will leave this in the issue queue for
further consideration.

In the meantime, if you implement at setLanguage method on your local copy, 
feel free
to send it to me.  I will gladly include this in future releases and give you 
credit
in the source code.

Thanks,
Andrew

Original comment by ajporterfield@gmail.com on 11 Feb 2010 at 7:28

GoogleCodeExporter commented 8 years ago
I've though about this request off and on for the past few days and decided 
that 
language translation is not an area I want to pursue at this time.  It's an 
added 
complexity that I feel is unnecessary.  Unfortunately, this means that you will 
have to 
run the same search and replace commands each time you download and install a 
new 
release of this project.

Thanks again for your feedback and support of this project,
Anrew

Original comment by ajporterfield@gmail.com on 16 Feb 2010 at 5:39

GoogleCodeExporter commented 8 years ago
I wanted to mention that the latest version release - 1.0.2 - has two form 
attributes (errorMsgFormat and 
emailErrorMsgFormat) that can be used to format the error message that are 
returned.

Original comment by ajporterfield@gmail.com on 27 Mar 2010 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by moncojhr@gmail.com on 12 Apr 2010 at 5:02

GoogleCodeExporter commented 8 years ago
The fields should also be multilanguage: by example the True/False or Yes/No 
fields.
In all there is no much translation required, I have about 10 or 15 items.
I don't see the complexity in this, add a folder "translations" to the project 
with a
subfolder for every ISO language that is supported, by example en, fr, de, ...
That folder should contain a class.form.php file with defines for the correct
constants. In your class you use the constants instead of the hardcoded english 
labels.
Then there should be a parameter for the form where you can set the language. By
example: language => 'en'. By default you hardcode it in english (en), unless 
the
parameter given is checked succesfully for an existng translation file.

I can deliver dutch (nl) translations if you want to proceed with this. 

Original comment by uwictpar...@gmail.com on 3 Jun 2010 at 2:59

GoogleCodeExporter commented 8 years ago
Thanks for your suggestion.  Feel free to provide the dutch translations.  If 
you would like, you can integrate your 
constants idea directly into class.form.php.  You can checkout a current 
snapshot of the working copy by running  
the following command...

svn checkout http://php-form-builder-class.googlecode.com/svn/trunk/ 
php-form-builder-class

Original comment by ajporterfield@gmail.com on 3 Jun 2010 at 3:15

GoogleCodeExporter commented 8 years ago
Apparantly it is more complicated than that. If I'm not mistaking, the js.php 
and
css.php did not exist in the previous version I'm using and I did not encounter 
this
issue before.

The issue I have now is residing within the js.php file. It initiates a new 
instance
of the class.form.php file so this would mean that the language should be saved 
in
the serialised class session variable

Original comment by uwictpar...@gmail.com on 3 Jun 2010 at 3:36

GoogleCodeExporter commented 8 years ago
The js.php/css.php implementation was introduced in the 1.0.4 version release 
to accomodate xhtml strict compliance.  Basically, the js/css 
needed for a specific form is loaded into external files instead of being 
dumped into the body tag alongside the form's html markup.

The serialization/un-serialization of the the class session variable is already 
handled for you near the bottom of the elementsToString() function 
(which is invoked within the render() function).

Please let me know if you have any further questions on the inner workings of 
the project.

Original comment by ajporterfield@gmail.com on 3 Jun 2010 at 5:39

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I would like to use PFBC in portuguese and I'm thinking in use gettext and 
contribute it to the project. Any drawback related to this?

Best regards,
Carlos.

Original comment by Webmaste...@gmail.com on 20 Mar 2012 at 12:44

GoogleCodeExporter commented 8 years ago
I agree with this issue, all texts should really be grouped somewhere ...
I'd like to use this class on multilingual websites and it's quite silly to 
have to duplicate ALL source code and manually search for every texts for every 
language ...
Not to mention that it has to be done again if we want to upgrade your script 
...

Original comment by conort on 22 Nov 2012 at 9:37

GoogleCodeExporter commented 8 years ago
I suppose you could wrap the form attributes (errorMsgFormat and 
emailErrorMsgFormat) values within gettext. I have not tried this but there 
should be no harm.

As long as the class keeps the same form attribute names, then your gettext 
values should not have an issue upon upgrading the class.

Original comment by elvis.mc...@gmail.com on 3 Nov 2014 at 6:13