Saturday, 15 September 2012

translation - PHP use gettext to translate an array -



translation - PHP use gettext to translate an array -

i have web page in php , i'm translating gettext _("string_to_translate").

i have in db 1 table user profiles website. set them in selection box take one.

now want translate profile names.

is there way translate (using gettext) profile names coming database?

code illustration of selection box:

while($row = mysqli_fetch_array($result_user_type)) { echo "<option $selected value=\"".$row['id']."\">".$row['designation']." </option>"; }

wouldnt do...

while($row = mysqli_fetch_array($result_user_type)) { echo "<option $selected value=\"".$row['id']."\">"._($row['designation'])." </option>"; }

im not sure though, never used gettext or if function takes argument , returns translated string, should it.

php translation gettext

No comments:

Post a Comment