Commit 1db93f6f authored by ZeMKI's avatar ZeMKI
Browse files

Translations

* now the translations are fully programmed, a documentation file on office will explain how to add them.
parent 43ec1583
......@@ -39,7 +39,7 @@ Vue.config.debug = true;
Vue.config.silent = false;
Vue.prototype.trans = (key) => {
return _.findKey(window.trans,key)? window.trans[_.findKey(window.trans,key)][key] : key;
return _.isUndefined(window.trans[key])? key : window.trans[key];
};
/**
......
<template>
<section style="margin-left:auto;margin-right:auto;position: fixed;">
<button class="button is-danger" v-if="!loadingprogress > 0" id="downloadbutton" style="display: flex;z-index: 1000;margin: 5px;position: fixed;" @click="download" > export PDF</button>
<button class="button is-danger" v-if="!loadingprogress > 0" id="downloadbutton" style="display: flex;z-index: 1000;margin: 5px;position: fixed;" @click="download" >{{ trans('export PDF') }}</button>
<img v-show="!loading" :src="screenshot" id="sorting" style="max-width: 100%;max-height: 100%;position:fixed;left:10%">
<div class="columns" style="top:50%;left: 50%;position: fixed;" :class="loading? 'columns loading' : 'columns'"></div>
<div id="bottom" v-show="!loading" style="display: flex;z-index: 1000;margin: 5px;position: fixed;bottom:0px;width:100%;background-color:#e9e7e3;display: inline;">
......
......@@ -17,20 +17,20 @@
{{ props.row.id }}
</b-table-column>
<b-table-column field="email" label="Author" sortable>
<b-table-column field="email" :label="trans('Author')" sortable>
{{ props.row.author }}
</b-table-column>
<b-table-column field="name" label="Interviewee" sortable>
<b-table-column field="name" :label="trans('Interviewee')" sortable>
{{ props.row.interviewed }}
</b-table-column>
<b-table-column field="date" label="Start" centered sortable>
<b-table-column field="date" :label="trans('Start')" centered sortable>
<span class="tag is-success">
{{ formatdate(props.row.start) }}
</span>
</b-table-column>
<b-table-column field="date" label="End" centered sortable>
<b-table-column field="date" :label="trans('End')" centered sortable>
<span class="tag is-success">
{{ formatdate(props.row.end) }}
</span>
......@@ -64,7 +64,7 @@
<template slot="empty">
<section class="section">
<div class="content has-text-grey has-text-centered">
<p>No interviews.</p>
<p>{{ trans('No interviews.') }}</p>
</div>
</section>
</template>
......
......@@ -19,11 +19,10 @@
<a class="button navigation-question-next"
@click="interview.presortindex++"
:disabled="questions.presort.length == interview.presortindex-1"
v-show="interview.presortindex < questions.presort.length-1"> Next Question
> </a>
v-show="interview.presortindex < questions.presort.length-1"> {{ trans('Next Question') }} > </a>
<a class="button navigation-question-previous"
@click="interview.presortindex--" :disabled="interview.presortindex == 0"
v-show="interview.presortindex > 0"> < Previous Question </a>
v-show="interview.presortindex > 0"> < {{ trans('Previous Question') }} </a>
<div class="control" v-if="a.type =='open'">
<textarea class="textarea is-large" type="text" placeholder="OPEN ANSWER"
v-model="results[x.answer.ids[answerindex]]">
......@@ -116,10 +115,10 @@
<a class="button navigation-question-next"
@click="interview.postsortindex++"
:disabled="questions.postsort.length == interview.postsortindex-1"
v-show="interview.postsortindex < questions.postsort.length-1"> Next Question > </a>
v-show="interview.postsortindex < questions.postsort.length-1"> {{ trans('Next Question') }} ></a>
<a class="button navigation-question-previous "
@click="interview.postsortindex--" :disabled="interview.postsortindex == 0"
v-show="interview.postsortindex > 0"> < Previous Question </a>
v-show="interview.postsortindex > 0"> < {{ trans('Previous Question') }} </a>
<div class="control" v-if="a.type =='open'">
<textarea class="textarea is-large" type="text" placeholder="OPEN ANSWER"
......
......@@ -39,7 +39,7 @@
<div class="modal-card" style="width: auto">
<header class="modal-card-head">
<p class="modal-card-title">Create new token</p>
<p class="modal-card-title">{{ trans('Create new token') }}</p>
</header>
<section class="modal-card-body modal-newtoken">
<div :class="Object.keys(newinterview.newtoken).length !== 0 ? 'token-img-newtokenInterview m-auto w-auto h-auto' : 'token-img-newtokenInterview m-auto'" >
......@@ -47,11 +47,11 @@
style="vertical-align: bottom; ">
</div>
<div class="card-content">
<label class="label">Token name</label>
<label class="label">{{ trans('Token name') }}</label>
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="text" v-model="newinterview.newtoken.name"/>
<label class="label mt-5">Preset tokens</label>
<label class="label mt-5">{{ trans('Preset tokens') }}</label>
<v-select class="":options="newinterview.imagepreset" label="basename" v-model="newinterview.newtoken.file"
>
<template slot="label" slot-scope="label">
......@@ -71,7 +71,7 @@
<b-upload v-model="newinterview.newtoken.file"
accept="image/*">
<a class="button is-danger">
<div class="md:text-sm">Click to upload</div>
<div class="md:text-sm">{{ trans('Click to upload') }}</div>
</a>
<br>
</b-upload>
......@@ -80,7 +80,7 @@
<a :disabled="newinterview.newtoken.name == null || newinterview.newtoken.name == ''"
:class="newinterview.newtoken.name != null || newinterview.newtoken.name == ''? 'button is-primary text-2xl m-auto w-auto': 'button is-primary text-2xl opacity-50 cursor-not-allowed m-auto w-auto'"
@click.prevent="saveToken">
Save
{{ trans('Save') }}
</a>
</div>
</section>
......
......@@ -2,7 +2,7 @@
<section>
<div :class="'sorting-container'+currentsorting" :id="'sortingc'+currentsorting"
style="scroll-behavior: unset;">
<h2 style="left:5%;position:absolute;top:15%;touch-action: none" class="remove-from-screenshot">Choose from prepared tokens.</h2>
<h2 style="left:5%;position:absolute;top:15%;touch-action: none" class="remove-from-screenshot">{{ trans('Choose from prepared tokens.') }}</h2>
<div class="token-container has-to-move flex flex-row" id="token-container" style="top:20%;left:5%;height: 50%;width:25%;flex-wrap: wrap;">
......@@ -53,7 +53,7 @@
</new-token>
<div class="token-container-created z-20 max-h-screen has-to-move"
style="max-width: 20%;top:20%;">
<h3 style="min-width:20%;" class="remove-from-screenshot relative">Your Created Tokens.</h3>
<h3 style="min-width:20%;" class="remove-from-screenshot relative">{{ trans('Your Created Tokens.') }} </h3>
<div class="sortingstart inline-block createdtokens" :class="'token'+currentsorting"
v-for="(t,index) in tokens"
......
{
"E-Mail Address": "E-Mail Address",
"New Study": "New Study",
"New Study": "New Studyyyy",
"Language": "Language",
"Create Study": "DaI!",
"To create a new study, you should provide some general information, choose a sorting scheme you wish to use and can add additional questions for your interviewees. To navigate between these options please use the three tabs provided below.": "To create a new study, you should provide some general information, choose a sorting scheme you wish to use and can add additional questions for your interviewees. To navigate between these options please use the three tabs provided below."
"Create Study": "funzia?",
"To create a new study, you should provide some general information, choose a sorting scheme you wish to use and can add additional questions for your interviewees. To navigate between these options please use the three tabs provided below.": "To create a new study, you should provide some general information, choose a sorting scheme you wish to use and can add additional questions for your interviewees. To navigate between these options please use the three tabs provided below.",
"Please give your study a name, assign one or more responsible researchers and add a short description. All information is mandatory to successful save the study.": "sì",
"Choose Sorting Scheme": "Choose sorting scheme",
"Create new study": "Crea uno studio nuovo."
}
\ No newline at end of file
......@@ -28,6 +28,8 @@
window.trans = [];
window.trans = <?php
// copy all translations from /resources/lang/CURRENT_LOCALE/* to global JS variable
/*
$lang_files = File::files(resource_path() . '/lang/' . App::getLocale());
$trans = [];
foreach ($lang_files as $f) {
......@@ -35,8 +37,12 @@
$trans[$filename] = trans($filename);
}
*/
$json_file = File::get(resource_path()."/lang/". App::getLocale().'.json');
echo json_encode($trans,true);
echo json_decode(json_encode($json_file, true));;
?>;
</script>
@yield('pagespecificstyles')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment