Commit 43ec1583 authored by ZeMKI's avatar ZeMKI
Browse files

Translations + Bug solved

* improved translation package (still need working)
* solved bug: now token name can contain dot(s)
parent bb91da5f
......@@ -28,4 +28,4 @@ package.json
*.js
.idea/workspace.xml
.idea/
......@@ -10,4 +10,40 @@ D
T
$app/Providers/AppServiceProvider.php,4/8/48b8d8112e9bdd32ee7e25b1224d6739eece1e72
Z
*app/Providers/TelescopeServiceProvider.php,1/0/10ad88bdd38452e04635ff6c64e630f9299c3493
\ No newline at end of file
*app/Providers/TelescopeServiceProvider.php,1/0/10ad88bdd38452e04635ff6c64e630f9299c3493
>
config/app.php,7/3/734f7be25e8008acc7129e73cd116d5de913e6fd
s
Cdatabase/migrations/2018_04_04_145119_create_translations_table.php,9/3/93e60bcd96644207e9c3d26f46bcd4da16c84855
j
:resources/views/vendor/translation-manager/index.blade.php,0/f/0f3efd2f7648d0d9067c7e3726db8210da04a7a8
U
%resources/views/layouts/app.blade.php,4/e/4e52e2a63befd1dc69600001e78b80ebece1ac9b
N
config/translation-manager.php,f/9/f9e13010f3f6cbf85b138b4c2965598fe666b1b2
U
%resources/views/layouts/nav.blade.php,d/5/d545277694b3c631cf6ab6c9c94abf45f9e45651
C
resources/js/app.js,8/5/857628e89e6d3e0f341720284d70b5f44c757924
T
$resources/js/components/newstudy.vue,8/c/8cce6f20b1baf3aa041cd6ed78f9e96f665d3442
>
routes/web.php,6/b/6b9a783d9b43fee50fd28f56dbd1856d2608f305
F
resources/lang/en.json,8/b/8b5e96df9888a750062c4bde970e6616bfdcd9fc
W
'app/Http/Controllers/HomeController.php,9/c/9c8530715f6b05b710e3fa767bada1e4d0297e47
X
(resources/views/layouts/header.blade.php,8/4/84054216a8073416c8d010c1f855db303b476d54
K
resources/lang/en/_json.php,3/c/3c63a7df55d860ca9c65a238a84d3e51971fded6
d
4resources/views/vendor/translation-manager/index.php,e/b/eb065fb667ea2094d0fa4d4f22669070ba153ce5
J
resources/lang/de/auth.php,e/7/e7c9df1efee259bcc12a41e2e89238c9a8d64103
J
resources/lang/en/auth.php,5/0/50eb9a429e5326ea182e5681a15e410f355ac1cb
K
resources/lang/de/_json.php,c/0/c04be321b002113bdf277898675d5caf90bbfe05
F
resources/lang/de.json,e/2/e2dbb49b29c878fa8265508c4e89578b54a3aee8
\ No newline at end of file
......@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;
use Image;
use Storage;
use Helper;
class Token extends Model
{
......@@ -102,9 +103,12 @@ class Token extends Model
if (file_exists($studyPath . $name . '.mtoken')) {
$name = now()->timestamp . $name;
}
$extension = Helper::extension($image);
// open file a image resource
Image::make($image)->fit(100, 100)->save($studyPath . $name);
$path = $studyPath . $name;
$path = $studyPath . $name.".".$extension;
Image::make($image)->fit(100, 100)->save($path);
$encryptedContent = encrypt($base64FirstPart . ',' . base64_encode(file_get_contents($path)));
$encryptedName = 'study' . $newStudy->id . '/tokens/' . $name . '.mtoken';
// Store the encrypted Content
......
......@@ -37,6 +37,11 @@ if (process.env.MIX_ENV_MODE === 'production') {
Vue.config.devtools = true;
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;
};
/**
* Next, we will create a fresh Vue application instance and attach it to
* the page. Then, you may begin adding components to this application
......
......@@ -2,34 +2,28 @@
<div class="container">
<form enctype="multipart/form-data">
<h1 class="has-text-blue has-text-uppercase text-6xl font-extrabold">Create study</h1>
<h6 class="subtitle has-text-danger mt-1">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.</h6>
<h1 class="has-text-blue has-text-uppercase text-6xl font-extrabold">{{ trans('Create Study') }}</h1>
<h6 class="subtitle has-text-danger mt-1">{{ trans('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.') }}</h6>
<section class="section">
<b-tabs position="is-centered" class="block" size="is-medium" expanded>
<b-tab-item label="Study details" data-toggle="tab">
<h6 class="subtitle has-text-danger mt-2">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.
<h6 class="subtitle has-text-danger mt-2">
{{ trans('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.')}}
</h6>
<div class="columns">
<div class="column">
<div class="field">
<label class="label"
:class="response.indexOf(errormessages.studyname) > -1 ? 'is-red text-uppercase': 'text-uppercase'">Study
Name</label>
:class="response.indexOf(errormessages.studyname) > -1 ? 'is-red text-uppercase': 'text-uppercase'">
{{ trans('Study Name') }}
</label>
<div class="control w-full">
<textarea class="textarea w-full"
style="resize: none;white-space: nowrap;overflow-x: scroll;"
:class="response.indexOf(errormessages.studyname) > -1 ? 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400 is-danger': 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400'"
type="text" placeholder="Study name" id="studyname" v-model="name"
type="text" placeholder="" id="studyname" v-model="name"
:maxlength="inputlength.studyname" row="1">
</textarea>
<span
......@@ -41,7 +35,7 @@
<div class="column">
<div class="field">
<label class="label">Responsible Researcher(s)</label>
<label class="label">{{ trans('Responsible Researcher(s)') }}</label>
<div class="control">
<textarea class="textarea"
:class="response.indexOf(errormessages.author) > -1 ? 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400 is-danger': 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400'"
......@@ -58,7 +52,7 @@
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Short description of study</label>
<label class="label">{{ trans('Short description of study') }}</label>
<div class="control">
<textarea class="textarea"
:class="response.indexOf(errormessages.short_description) > -1 ? 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400 is-danger': 'bg-gray-200 focus:bg-white border-transparent focus:border-blue-400'"
......@@ -75,15 +69,15 @@
</b-tab-item>
<b-tab-item label="Select Sorting options">
<h6 class="subtitle has-text-danger mt-2">Please provide your study with instructions for the
interviewee,
select a sorting scheme and
define sorting tokens according to your needs, or use preset tokens.</h6>
<h6 class="subtitle has-text-danger mt-2">
{{ trans('Please provide your study with instructions for the interviewee, select a sorting scheme and define sorting tokens according to your needs, or use preset tokens.') }}
</h6>
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Text displayed for the interviewees, e.g. sorting
instructions</label>
<label class="label">
{{ trans('Text displayed for the interviewees, e.g. sorting instructions') }}
</label>
<div class="control w-full">
<textarea v-model="sorting.description"
class="textarea bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -101,7 +95,9 @@
<div class="column is-one-fifth">
<div class="level">
<div class="field">
<label class="label">Choose Sorting Scheme</label>
<label class="label">
{{ trans('Choose Sorting Scheme') }}
</label>
<div class="has-background-dark level" style="padding: 15px">
<span class="icon">
<arrow-left class="has-text-light"/>
......@@ -182,7 +178,9 @@
<b-upload v-model="t.file" @input="settokenname(index)"
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>
......@@ -195,7 +193,9 @@
</div>
</div>
</div>
<label class="label is-small mt-5">Add attributes to tokens? <br> Choose from a set:</label>
<label class="label is-small mt-5">
{{trans('Add attributes to tokens? Choose from a set:')}}
</label>
<v-select :options="classifiers[1]" label="name" v-model="sorting.classifier">
<template slot="label" slot-scope="label">
{ option.name }}
......@@ -210,11 +210,9 @@
</b-tab-item>
<b-tab-item label="Questions">
<h6 class="subtitle has-text-danger mt-2">Here you can define questions that will be displayed
before
or
after the sorting;
you can choose between different kinds of question formats as well.</h6>
<h6 class="subtitle has-text-danger mt-2">
{{ trans('Here you can define questions that will be displayed before or after the sorting; you can choose between different kinds of question formats as well.') }}
</h6>
<div class="columns">
<div class="column">
<div class="field">
......@@ -237,28 +235,27 @@
<input type="checkbox" checked v-model="q.ismultiple"
:disabled="q.isscale"
@input="unsetifmultiple(index,'presort')">
Multiple Choice
{{ trans('Multiple Choice') }}
</label>
<br class="clearfix">
<label class="checkbox">
<input type="checkbox" checked v-model="q.isonechoice"
:disabled="q.isscale"
@input="unsetifonechoice(index,'presort')">
One Choice
{{ trans('One Choice') }}
</label>
</div>
<div class="column">
<label class="checkbox">
<input type="checkbox" checked v-model="q.isopen"
:disabled="q.isscale">
Open Answer
{{ trans('Open Answer') }}
</label>
<br>
<label class="checkbox">
<input type="checkbox" checked v-model="q.isscale"
@input="unsetifscale(index,'presort')">
Scale values
{{ trans('Scale values') }}
</label>
</div>
</div>
......@@ -284,13 +281,17 @@
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Minimum Value</label>
<label class="label">
{{ trans('Minimum Value') }}
</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="number" v-model="q.scalemin" min="0">
</div>
<label class="label mt-2">Label Minimum Value</label>
<label class="label mt-2">
{{ trans('Label Minimum Value') }}
</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -300,13 +301,15 @@
</div>
<div class="column">
<div class="field">
<label class="label">Max Value</label>
<label class="label">{{ trans('Max Value') }}</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="number" v-model="q.scalemax">
</div>
<label class="label mt-2">Label Max Value</label>
<label class="label mt-2">
{{ trans('Label Max Value') }}
</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -329,7 +332,9 @@
</div>
<div class="field" v-for="(q,index) in postsort.questions">
<label class="label">Question</label>
<label class="label">
{{ trans('Question') }}
</label>
<div class="control">
<input v-model="q.question"
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -341,27 +346,27 @@
<input type="checkbox" checked v-model="q.ismultiple"
:disabled="q.isscale"
@input="unsetifmultiple(index,'postsort')">
Multiple Choice
{{ trans('Multiple Choice') }}
</label>
<br>
<label class="checkbox">
<input type="checkbox" checked v-model="q.isonechoice"
:disabled="q.isscale"
@input="unsetifonechoice(index,'postsort')">
One Choice
{{ trans('One Choice') }}
</label>
</div>
<div class="column">
<label class="checkbox">
<input type="checkbox" checked v-model="q.isopen"
:disabled="q.isscale">
Open Answer
{{ trans('Open Answer') }}
</label>
<br>
<label class="checkbox">
<input type="checkbox" checked v-model="q.isscale"
@click="unsetifscale(index,'postsort')">
Scale values
{{ trans('Scale values') }}
</label>
......@@ -390,13 +395,13 @@
<div class="columns">
<div class="column">
<div class="field">
<label class="label">Minimum Value</label>
<label class="label">{{ trans('Minimum Value') }}</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="number" v-model="q.scalemin" min="0">
</div>
<label class="label mt-2">Label Minimum Value</label>
<label class="label mt-2">{{ trans('Label Minimum Value') }}</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -406,13 +411,13 @@
</div>
<div class="column">
<div class="field">
<label class="label">Max Value</label>
<label class="label">{{ trans('Max Value') }}</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="number" v-model="q.scalemax">
</div>
<label class="label mt-2">Label Max Value</label>
<label class="label mt-2">{{ trans('Label Max Value') }}</label>
<div class="control">
<input
class="input bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
......@@ -436,11 +441,11 @@
<input v-if="!isedit" class="button is-primary float-right"
:class="{'is-loading' : loading}"
type="submit"
@click.prevent="createstudy()" value="Create new study">
@click.prevent="createstudy()" :value="trans('Create new study')">
<input v-if="isedit" class="button is-primary float-right"
:class="{'is-loading' : loading}"
type="submit"
@click.prevent="editstudy()" value="Edit current study">
@click.prevent="editstudy()" :value="trans('Edit current study')">
</div>
</div>
......
{
"E-Mail Address": "E-Mail Addresse",
"Language": "Sprache",
"New Study": "Neue Studie"
"New Study": "Neue Studie",
"Create Study": "Studie Erstellen",
"new study text": "boh",
"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.": "si dai",
"Choose Sorting Scheme": "Wählen Sie Sortierschema",
"Click to upload": "Hochladen",
"Add attributes to tokens? Choose from a set:": "sì madre"
}
\ No newline at end of file
<?php
return array (
'E-Mail Address' => 'E-Mail Addresse',
'Language' => 'Sprache',
'New Study' => 'Neue Studie',
'Create Study' => 'Studie Erstellen',
'new study text' => 'boh',
'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.' => 'si dai',
'Choose Sorting Scheme' => 'Wählen Sie Sortierschema',
'Click to upload' => 'Klicken Sie zum Hochladen',
'Add attributes to tokens? Choose from a set:' => 'sì madre',
);
File mode changed from 100755 to 100644
{
"E-Mail Address": "E-Mail Address",
"New Study": "New Study",
"Language": "Language"
"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."
}
\ No newline at end of file
<?php
return array (
'E-Mail Address' => 'E-Mail Address',
'New Study' => 'New Study',
'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' =>
array (
' To navigate between these options please use the three tabs provided below' =>
array (
'' => '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.',
),
),
);
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -24,6 +24,21 @@
<!-- Styles -->
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
<!-- page specific styles -->
<script>
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) {
$filename = pathinfo($f)['filename'];
$trans[$filename] = trans($filename);
}
echo json_encode($trans,true);
?>;
</script>
@yield('pagespecificstyles')
<!-- favicon -->
......
......@@ -111,7 +111,7 @@
{{ __('German') }}
</a>
<a class="text-center w-full lg:inline-block lg:mt-0 mr-4 menu-item has-background-white-ter shadow-sm px-5 py-2"
href="{{ url('switch/de') }}"
href="{{ url('switch/en') }}"
>
{{ __('Englisch') }}
</a>
......
......@@ -46,6 +46,7 @@ Route::group(['prefix' => 'admin', 'middleware' => ['role:superadministrator']],
Route::group(['middleware' => ['auth', 'verified']], static function () {
Route::get('/', 'HomeController@index')->name('home');
Route::get('switch/{locale}', 'HomeController@changeLanguage');
Route::get('/studies/new', 'StudyController@create');
Route::post('/studies', 'StudyController@store');
......
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