Own language to col title

QuestionsOwn language to col title
C3media asked 7 years ago

Hello,

There is a way to create my own language based in col title, for example:
$col["title"] = "Estado"; then when change language show it.

Thank you!

2 Answers
Abu Ghufran answered 7 years ago

You can put IF, ELSE IF calls for it. There is no built in support for this.
e.g.

if ($lang == 'en')
$col1_title = "test";
else if ($lang == 'de')
$col1_title = "test-de";
else if ($lang == 'es')
$col1_title = "test-es";

and then use it in column title,
$col["title"] = $col1_title;

C3media answered 7 years ago

Ok Abu,

This is my code to change language, based in change styles:

<?php
//Create language array
$language = array("english","spanish","italy");
$j = rand(0,8);

// if set from page
if (is_numeric($_GET["languageid"]))
$j = $_GET["languageid"];
else
$j = 1;

?>

//Add string folder from array to path library languages
<head>
<script src="lib/js/jqgrid/js/i18n/<?php echo $language[$j] ?>.js" type="text/javascript"></script>
</head>

//Then in body

<body>
<form method="get">
Change language: <select name="languageid" onchange="form.submit()">
<?php foreach($language as $l=>$u) { ?>
<option value=<?php echo $l?> <?php echo ($j==$l)?"selected":"1"?>><?php echo ucwords($u)?></option>
<?php } ?>
</select>
</form>
</body>

Finally, ¿may to add sentence if in file spanish.js for example?
I believe it's more suitable.

Thank you!

Your Answer

14 + 7 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?