要在html代码中注入的Javascript变量

The Scope of my project is to translate several webpages on a different language. I created a table in MS SQL DB with the first column as element ID (e.g. el0). The Other columns represent text translation, each column with different language lets say on the same row (el0) in English I got a string "Group" on the next column lets say it is German the string "Gruppe". I got an intranet site used for reporting, and on this website I want to implement a language dropdown list, what will translate the webpage on a desired format. At the moment the webpage is already created and the text is static for each menu. I got a query what is running at the load phase of the webpage and returns from the DB a multidimensional array in php.

    Array
(
    [0] => Array
        (
            [0] => el1
            [1] => Grouping
        )

    [1] => Array
        (
            [0] => el2
            [1] => Type
        )

    [2] => Array
        (
            [0] => el3
            [1] => Starting Date
        )

    [3] => Array
        (
            [0] => el4
            [1] => Ending Date
        )

    [4] => Array
        (
            [0] => el5
            [1] => Section
        )

    [5] => Array
        (
            [0] => el6
            [1] => Cell
        )

    [6] => Array
        (
            [0] => el7
            [1] => Client
        )

    [7] => Array
        (
            [0] => el8
            [1] => Status
        )

    [8] => Array
        (
            [0] => el9
            [1] => Article
        )

    [9] => Array
        (
            [0] => el10
            [1] => Search
        )

)

I had transformed this array in javascript first value as new variable and the second value as the value of the newly created variable.

foreach ($language_array as $value) {
  echo "<script> var ".$value[0]." = ". json_encode($value[1]).";</script>";
    }

I was thinking that in this way I will be able to insert javascript variable in html for each static quest, but it seems I can't use the way I was thinking e.g.:

<script>document.write(el0);</script>

a part of the html page where I want to use the variable values:

<tr>    
    <td colspan ="8" align="center" class="first">***variable value from el1***</td>
    <td colspan ="8" align="center" class="first">***variable value from el2***</td>
    <td colspan="3" align="center" class='first'>***variable value from el3***</td>
    <td colspan="3" align="center" class='first'>***variable value from el3***</td>
</tr>

please assist me how can I fulfill the requirements?

Thanks

Ervin