i18n language generate script from aws

pull/813/head^2
hunterlong 2020-09-09 14:11:32 -07:00
parent ec528befcf
commit 6ca458186d
30 changed files with 1049 additions and 544 deletions

View File

@ -44,6 +44,8 @@ jobs:
COMMIT: ${{ github.sha }} COMMIT: ${{ github.sha }}
MJML_APP: ${{ secrets.MJML_APP }} MJML_APP: ${{ secrets.MJML_APP }}
MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: make clean generate compile run: make clean generate compile
- name: Upload Compiled Frontend (rice-box.go) - name: Upload Compiled Frontend (rice-box.go)

View File

@ -44,6 +44,8 @@ jobs:
COMMIT: ${{ github.sha }} COMMIT: ${{ github.sha }}
MJML_APP: ${{ secrets.MJML_APP }} MJML_APP: ${{ secrets.MJML_APP }}
MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }} MJML_PRIVATE: ${{ secrets.MJML_PRIVATE }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: make clean generate compile run: make clean generate compile
- name: Upload Compiled Frontend (rice-box.go) - name: Upload Compiled Frontend (rice-box.go)

View File

@ -1,6 +1,7 @@
# 0.90.66 (09-08-2020) # 0.90.66 (09-08-2020)
- Added Import and Export views in Dashboard - Added Import and Export views in Dashboard
- Modified services list sparkline to use start/end of day timestamp - Modified services list sparkline to use start/end of day timestamp
- Modified i18n language files, added go generate script to automatically translate
# 0.90.65 (09-01-2020) # 0.90.65 (09-01-2020)
- Fixed issue with dashboard not logging in (notifier panic) - Fixed issue with dashboard not logging in (notifier panic)

View File

@ -3,23 +3,23 @@
<div class="row stats_area mb-5"> <div class="row stats_area mb-5">
<div class="col-4"> <div class="col-4">
<span class="font-6 font-weight-bold d-block">{{$store.getters.services.length}}</span> <span class="font-6 font-weight-bold d-block">{{$store.getters.services.length}}</span>
<span class="font-2">{{ $t('dashboard.total_services') }}</span> <span class="font-2">{{ $t('total_services') }}</span>
</div> </div>
<div class="col-4"> <div class="col-4">
<span class="font-6 font-weight-bold d-block">{{failuresLast24Hours()}}</span> <span class="font-6 font-weight-bold d-block">{{failuresLast24Hours()}}</span>
<span class="font-2">{{ $t('dashboard.failures_24_hours') }}</span> <span class="font-2">{{ $t('failures_24_hours') }}</span>
</div> </div>
<div class="col-4"> <div class="col-4">
<span class="font-6 font-weight-bold d-block">{{$store.getters.onlineServices(true).length}}</span> <span class="font-6 font-weight-bold d-block">{{$store.getters.onlineServices(true).length}}</span>
<span class="font-2">{{ $t('dashboard.online_services') }}</span> <span class="font-2">{{ $t('online_services') }}</span>
</div> </div>
</div> </div>
<div class="col-12" v-if="services.length === 0"> <div class="col-12" v-if="services.length === 0">
<div class="alert alert-dark d-block"> <div class="alert alert-dark d-block">
You currently don't have any services! {{$t('no_services')}}
<router-link v-if="$store.state.admin" to="/dashboard/create_service" class="btn btn-sm btn-success float-right"> <router-link v-if="$store.state.admin" to="/dashboard/create_service" class="btn btn-sm btn-success float-right">
<font-awesome-icon icon="plus"/> Create <font-awesome-icon icon="plus"/> {{ $t('create') }}
</router-link> </router-link>
</div> </div>
</div> </div>

View File

@ -2,9 +2,9 @@
<div class="col-12"> <div class="col-12">
<div class="card contain-card mb-4"> <div class="card contain-card mb-4">
<div class="card-header">{{ $t('top_nav.services') }} <div class="card-header">{{ $t('services') }}
<router-link v-if="$store.state.admin" to="/dashboard/create_service" class="btn btn-sm btn-success float-right"> <router-link v-if="$store.state.admin" to="/dashboard/create_service" class="btn btn-sm btn-success float-right">
<font-awesome-icon icon="plus"/> Create <font-awesome-icon icon="plus"/> {{$t('create')}}
</router-link> </router-link>
</div> </div>
<div class="card-body pt-0"> <div class="card-body pt-0">
@ -13,7 +13,7 @@
</div> </div>
<div class="card contain-card mb-4"> <div class="card contain-card mb-4">
<div class="card-header">{{ $t('top_nav.groups') }}</div> <div class="card-header">{{ $t('groups') }}</div>
<div class="card-body pt-0"> <div class="card-body pt-0">
<div v-if="groupsList.length === 0"> <div v-if="groupsList.length === 0">
@ -25,9 +25,9 @@
<table v-else class="table"> <table v-else class="table">
<thead> <thead>
<tr> <tr>
<th scope="col">{{ $t('dashboard.name') }}</th> <th scope="col">{{ $t('name') }}</th>
<th scope="col" class="d-none d-md-table-cell">{{ $tc('dashboard.service', 2) }}</th> <th scope="col" class="d-none d-md-table-cell">{{ $tc('service', 2) }}</th>
<th scope="col">{{ $t('dashboard.visibility') }}</th> <th scope="col">{{ $t('visibility') }}</th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
</thead> </thead>

View File

@ -2,9 +2,9 @@
<div class="row"> <div class="row">
<h5 v-if="group.name && group_services" class="h5 col-12 mb-3 mt-2 text-dim"> <h5 v-if="group.name && group_services" class="h5 col-12 mb-3 mt-2 text-dim">
<font-awesome-icon @click="toggle" :icon="expanded ? 'minus' : 'plus'" class="pointer mr-3"/> {{group.name}} <font-awesome-icon @click="toggle" :icon="expanded ? 'minus' : 'plus'" class="pointer mr-3"/> {{group.name}}
<span class="badge badge-success text-uppercase float-right ml-2">{{services_online.length}} online</span> <span class="badge badge-success text-uppercase float-right ml-2">{{services_online.length}} {{$t('online')}}</span>
<span v-if="services_online.services_offline > 0" class="badge badge-danger text-uppercase float-right"> <span v-if="services_online.services_offline > 0" class="badge badge-danger text-uppercase float-right">
{{services_offline.length}} offline {{services_offline.length}} {{$t('offline')}}
</span> </span>
</h5> </h5>
<div class="col-12 col-md-4" v-if="expanded" v-for="service in group_services"> <div class="col-12 col-md-4" v-if="expanded" v-for="service in group_services">

View File

@ -54,7 +54,7 @@
</div> </div>
<span v-for="(failure, index) in failures" v-bind:key="index" class="alert alert-light"> <span v-for="(failure, index) in failures" v-bind:key="index" class="alert alert-light">
Failed {{failure.created_at}}<br> {{ $t('failed') }} {{failure.created_at}}<br>
{{failure.issue}} {{failure.issue}}
</span> </span>

View File

@ -9,29 +9,29 @@
<div class="navbar-collapse" :class="{collapse: !navopen}" id="navbarText"> <div class="navbar-collapse" :class="{collapse: !navopen}" id="navbarText">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<li @click="navopen = !navopen" class="nav-item navbar-item"> <li @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard" class="nav-link">{{ $t('top_nav.dashboard') }}</router-link> <router-link to="/dashboard" class="nav-link">{{ $t('dashboard') }}</router-link>
</li> </li>
<li @click="navopen = !navopen" class="nav-item navbar-item"> <li @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/services" class="nav-link">{{ $t('top_nav.services') }}</router-link> <router-link to="/dashboard/services" class="nav-link">{{ $t('services') }}</router-link>
</li> </li>
<li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item"> <li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/users" class="nav-link">{{ $t('top_nav.users') }}</router-link> <router-link to="/dashboard/users" class="nav-link">{{ $t('users') }}</router-link>
</li> </li>
<li @click="navopen = !navopen" class="nav-item navbar-item"> <li @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/messages" class="nav-link">{{ $t('top_nav.announcements') }}</router-link> <router-link to="/dashboard/messages" class="nav-link">{{ $t('announcements') }}</router-link>
</li> </li>
<li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item"> <li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/settings" class="nav-link">{{ $t('top_nav.settings') }}</router-link> <router-link to="/dashboard/settings" class="nav-link">{{ $t('settings') }}</router-link>
</li> </li>
<li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item"> <li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/logs" class="nav-link">{{ $t('top_nav.logs') }}</router-link> <router-link to="/dashboard/logs" class="nav-link">{{ $t('logs') }}</router-link>
</li> </li>
<li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item"> <li v-if="admin" @click="navopen = !navopen" class="nav-item navbar-item">
<router-link to="/dashboard/help" class="nav-link">{{ $t('top_nav.help') }}</router-link> <router-link to="/dashboard/help" class="nav-link">{{ $t('help') }}</router-link>
</li> </li>
</ul> </ul>
<span class="navbar-text"> <span class="navbar-text">
<a href="#" class="nav-link" @click.prevent="logout">{{ $t('top_nav.logout') }}</a> <a href="#" class="nav-link" @click.prevent="logout">{{ $t('logout') }}</a>
</span> </span>
</div> </div>
</nav> </nav>

View File

@ -3,7 +3,7 @@
<div v-if="!core.footer" class="footer text-center mb-4 p-2"> <div v-if="!core.footer" class="footer text-center mb-4 p-2">
<div class="d-block text-dim"> <div class="d-block text-dim">
<div class="mb-3"> <div class="mb-3">
<router-link class="links" :to="admin ? '/dashboard' : '/login'">{{$t('top_nav.dashboard')}}</router-link> <router-link class="links" :to="admin ? '/dashboard' : '/login'">{{$t('dashboard')}}</router-link>
</div> </div>
<span class="font-1 mt-3"> <span class="font-1 mt-3">
<a href="https://github.com/statping/statping" class="statping" target="_blank"> <a href="https://github.com/statping/statping" class="statping" target="_blank">

View File

@ -15,11 +15,11 @@
<div class="row mt-2"> <div class="row mt-2">
<div class="col-12 no-select"> <div class="col-12 no-select">
<p class="divided"> <p class="divided">
<span class="font-2 text-muted">90 Days Ago</span> <span class="font-2 text-muted">90 {{$t('days_ago')}}</span>
<span class="divider"></span> <span class="divider"></span>
<span class="text-center font-2" :class="{'text-muted': service.online, 'text-danger': !service.online}">{{service_txt}}</span> <span class="text-center font-2" :class="{'text-muted': service.online, 'text-danger': !service.online}">{{service_txt}}</span>
<span class="divider"></span> <span class="divider"></span>
<span class="font-2 text-muted">Today</span> <span class="font-2 text-muted">{{$t('today')}}</span>
</p> </p>
</div> </div>
</div> </div>

View File

@ -48,7 +48,7 @@
<div class="col-md-2 col-6 float-right"> <div class="col-md-2 col-6 float-right">
<button v-if="!expanded" @click="setService" class="btn btn-sm float-right dyn-dark text-white" :class="{'bg-success': service.online, 'bg-danger': !service.online}"> <button v-if="!expanded" @click="setService" class="btn btn-sm float-right dyn-dark text-white" :class="{'bg-success': service.online, 'bg-danger': !service.online}">
{{$t('service.view')}} {{$t('view')}}
</button> </button>
</div> </div>
</div> </div>

View File

@ -2,15 +2,15 @@
<div class="row stats_area mt-5 mb-4"> <div class="row stats_area mt-5 mb-4">
<div class="col-4"> <div class="col-4">
<span class="font-5 d-block font-weight-bold">{{humanTime(service.avg_response)}}</span> <span class="font-5 d-block font-weight-bold">{{humanTime(service.avg_response)}}</span>
<span class="font-1 subtitle">{{$t('service.average')}}</span> <span class="font-1 subtitle">{{$t('average_response')}}</span>
</div> </div>
<div class="col-4"> <div class="col-4">
<span class="font-5 d-block font-weight-bold">{{service.online_24_hours}} %</span> <span class="font-5 d-block font-weight-bold">{{service.online_24_hours}} %</span>
<span class="font-1 subtitle">{{$t('service.last_uptime', [24, $tc('hour', 24)])}}</span> <span class="font-1 subtitle">{{$t('last_uptime', [24, $tc('hour', 24)])}}</span>
</div> </div>
<div class="col-4"> <div class="col-4">
<span class="font-5 d-block font-weight-bold">{{service.online_7_days}} %</span> <span class="font-5 d-block font-weight-bold">{{service.online_7_days}} %</span>
<span class="font-1 subtitle">{{$t('service.last_uptime', [7, $tc('day', 7)])}}</span> <span class="font-1 subtitle">{{$t('last_uptime', [7, $tc('day', 7)])}}</span>
</div> </div>
</div> </div>
</template> </template>

View File

@ -16,10 +16,10 @@
<div class="form-group row"> <div class="form-group row">
<div class="col-sm-12"> <div class="col-sm-12">
<div v-if="error" class="alert alert-danger" role="alert"> <div v-if="error" class="alert alert-danger" role="alert">
{{$t('dashboard.wrong_login')}} {{$t('wrong_login')}}
</div> </div>
<button @click.prevent="login" type="submit" class="btn btn-block btn-primary" :disabled="disabled || loading"> <button @click.prevent="login" type="submit" class="btn btn-block btn-primary" :disabled="disabled || loading">
<font-awesome-icon v-if="loading" icon="circle-notch" class="mr-2" spin/>{{loading ? $t('dashboard.loading') : $t('dashboard.sign_in')}} <font-awesome-icon v-if="loading" icon="circle-notch" class="mr-2" spin/>{{loading ? $t('loading') : $t('sign_in')}}
</button> </button>
</div> </div>
</div> </div>

View File

@ -1,10 +1,10 @@
<template> <template>
<form v-if="service.type" @submit.prevent="saveService"> <form v-if="service.type" @submit.prevent="saveService">
<div class="card contain-card mb-4"> <div class="card contain-card mb-4">
<div class="card-header">{{ $t('service.info') }}</div> <div class="card-header">{{ $t('service_info') }}</div>
<div class="card-body"> <div class="card-body">
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-4 col-form-label">{{ $t('service.name') }}</label> <label class="col-sm-4 col-form-label">{{ $t('service_name') }}</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input v-model="service.name" @input="updatePermalink" id="name" type="text" name="name" class="form-control" placeholder="Server Name" required spellcheck="false" autocorrect="off"> <input v-model="service.name" @input="updatePermalink" id="name" type="text" name="name" class="form-control" placeholder="Server Name" required spellcheck="false" autocorrect="off">
<small class="form-text text-muted">Give your service a name you can recognize</small> <small class="form-text text-muted">Give your service a name you can recognize</small>

View File

@ -9,17 +9,21 @@
<div class="row"> <div class="row">
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.language') }}</label> <label class="text-capitalize">{{ $t('language') }}</label>
<select @change="changeLanguages" v-model="setup.language" id="language" class="form-control"> <select @change="changeLanguages" v-model="setup.language" id="language" class="form-control">
<option value="en">English</option> <option value="en">English</option>
<option value="es">Spanish</option> <option value="es">Spanish</option>
<option value="fr">French</option> <option value="fr">French</option>
<option value="ru">Russian</option> <option value="ru">Russian</option>
<option value="de">German</option> <option value="de">German</option>
<option value="ja">Japanese</option>
<option value="ko">Korean</option>
<option value="it">Italian</option>
<option value="zh">Chinese</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.connection') }}</label> <label class="text-capitalize">{{ $t('db_connection') }}</label>
<select @change="canSubmit" v-model="setup.db_connection" id="db_connection" class="form-control"> <select @change="canSubmit" v-model="setup.db_connection" id="db_connection" class="form-control">
<option value="sqlite">SQLite</option> <option value="sqlite">SQLite</option>
<option value="postgres">Postgres</option> <option value="postgres">Postgres</option>
@ -29,34 +33,34 @@
<div class="row"> <div class="row">
<div class="col-7 col-md-6"> <div class="col-7 col-md-6">
<div v-if="setup.db_connection !== 'sqlite'" class="form-group"> <div v-if="setup.db_connection !== 'sqlite'" class="form-group">
<label class="text-capitalize">{{ $t('setup.host') }}</label> <label class="text-capitalize">{{ $t('db_host') }}</label>
<input @keyup="canSubmit" v-model="setup.db_host" id="db_host" type="text" class="form-control" placeholder="localhost"> <input @keyup="canSubmit" v-model="setup.db_host" id="db_host" type="text" class="form-control" placeholder="localhost">
</div> </div>
</div> </div>
<div class="col-5 col-md-6"> <div class="col-5 col-md-6">
<div v-if="setup.db_connection !== 'sqlite'" class="form-group"> <div v-if="setup.db_connection !== 'sqlite'" class="form-group">
<label class="text-capitalize">{{ $t('port') }}</label> <label class="text-capitalize">{{ $t('db_port') }}</label>
<input @keyup="canSubmit" v-model="setup.db_port" id="db_port" type="number" class="form-control" placeholder="5432"> <input @keyup="canSubmit" v-model="setup.db_port" id="db_port" type="number" class="form-control" placeholder="5432">
</div> </div>
</div> </div>
</div> </div>
<div v-if="setup.db_connection !== 'sqlite'" class="form-group"> <div v-if="setup.db_connection !== 'sqlite'" class="form-group">
<label class="text-capitalize">{{ $t('username') }}</label> <label class="text-capitalize">{{ $t('db_username') }}</label>
<input @keyup="canSubmit" v-model="setup.db_user" id="db_user" type="text" class="form-control" placeholder="root"> <input @keyup="canSubmit" v-model="setup.db_user" id="db_user" type="text" class="form-control" placeholder="root">
</div> </div>
<div v-if="setup.db_connection !== 'sqlite'" class="form-group"> <div v-if="setup.db_connection !== 'sqlite'" class="form-group">
<label for="db_password" class="text-capitalize">{{ $t('password') }}</label> <label for="db_password" class="text-capitalize">{{ $t('db_password') }}</label>
<input @keyup="canSubmit" v-model="setup.db_password" id="db_password" type="password" class="form-control" placeholder="password123"> <input @keyup="canSubmit" v-model="setup.db_password" id="db_password" type="password" class="form-control" placeholder="password123">
</div> </div>
<div v-if="setup.db_connection !== 'sqlite'" class="form-group"> <div v-if="setup.db_connection !== 'sqlite'" class="form-group">
<label for="db_database" class="text-capitalize">{{ $t('setup.database') }}</label> <label for="db_database" class="text-capitalize">{{ $t('db_database') }}</label>
<input @keyup="canSubmit" v-model="setup.db_database" id="db_database" type="text" class="form-control" placeholder="Database name"> <input @keyup="canSubmit" v-model="setup.db_database" id="db_database" type="text" class="form-control" placeholder="Database name">
</div> </div>
<div class="form-group mt-3"> <div class="form-group mt-3">
<div class="row"> <div class="row">
<div class="col-9"> <div class="col-9">
<span class="text-left text-capitalize">{{ $t('setup.send_reports') }}</span> <span class="text-left text-capitalize">{{ $t('send_reports') }}</span>
</div> </div>
<div class="col-3 text-right"> <div class="col-3 text-right">
<span @click="setup.send_reports = !!setup.send_reports" class="switch"> <span @click="setup.send_reports = !!setup.send_reports" class="switch">
@ -72,32 +76,32 @@
<div class="col-12 col-md-6"> <div class="col-12 col-md-6">
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.project_name') }}</label> <label class="text-capitalize">{{ $t('project_name') }}</label>
<input @keyup="canSubmit" v-model="setup.project" id="project" type="text" class="form-control" placeholder="Work Servers" required> <input @keyup="canSubmit" v-model="setup.project" id="project" type="text" class="form-control" placeholder="Work Servers" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.project_description') }}</label> <label class="text-capitalize">{{ $t('description') }}</label>
<input @keyup="canSubmit" v-model="setup.description" id="description" type="text" class="form-control" placeholder="Monitors all of my work services"> <input @keyup="canSubmit" v-model="setup.description" id="description" type="text" class="form-control" placeholder="Monitors all of my work services">
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize" for="domain">{{ $t('setup.domain') }}</label> <label class="text-capitalize" for="domain">{{ $t('domain') }}</label>
<input @keyup="canSubmit" v-model="setup.domain" type="text" class="form-control" id="domain" required> <input @keyup="canSubmit" v-model="setup.domain" type="text" class="form-control" id="domain" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.username') }}</label> <label class="text-capitalize">{{ $t('username') }}</label>
<input @keyup="canSubmit" v-model="setup.username" id="username" type="text" class="form-control" placeholder="admin" required> <input @keyup="canSubmit" v-model="setup.username" id="username" type="text" class="form-control" placeholder="admin" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.password') }}</label> <label class="text-capitalize">{{ $t('password') }}</label>
<input @keyup="canSubmit" v-model="setup.password" id="password" type="password" class="form-control" placeholder="password" required> <input @keyup="canSubmit" v-model="setup.password" id="password" type="password" class="form-control" placeholder="password" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="text-capitalize">{{ $t('setup.password_confirm') }}</label> <label class="text-capitalize">{{ $t('confirm_password') }}</label>
<input @keyup="canSubmit" v-model="setup.confirm_password" id="password_confirm" type="password" class="form-control" placeholder="password" required> <input @keyup="canSubmit" v-model="setup.confirm_password" id="password_confirm" type="password" class="form-control" placeholder="password" required>
<span v-if="passnomatch" class="small text-danger">Both passwords should match</span> <span v-if="passnomatch" class="small text-danger">Both passwords should match</span>
</div> </div>
@ -109,14 +113,14 @@
<input @keyup="canSubmit" v-model="setup.email" id="email" type="text" class="form-control" placeholder="myemail@domain.com"> <input @keyup="canSubmit" v-model="setup.email" id="email" type="text" class="form-control" placeholder="myemail@domain.com">
</div> </div>
<div class="col-4 text-right"> <div class="col-4 text-right">
<label class="d-none d-sm-block text-capitalize text-capitalize">{{ $t('setup.newsletter') }}</label> <label class="d-none d-sm-block text-capitalize text-capitalize">{{ $t('newsletter') }}</label>
<span @click="setup.newsletter = !!setup.newsletter" class="switch"> <span @click="setup.newsletter = !!setup.newsletter" class="switch">
<input v-model="setup.newsletter" type="checkbox" name="send_newsletter" class="switch" id="send_newsletter" :checked="setup.newsletter"> <input v-model="setup.newsletter" type="checkbox" name="send_newsletter" class="switch" id="send_newsletter" :checked="setup.newsletter">
<label for="send_newsletter"></label> <label for="send_newsletter"></label>
</span> </span>
</div> </div>
</div> </div>
<small>{{ $t('setup.newsletter_note') }}</small> <small>{{ $t('newsletter_note') }}</small>
</div> </div>
</div> </div>
@ -126,7 +130,7 @@
<div class="col-12"> <div class="col-12">
<button @click.prevent="saveSetup" v-bind:disabled="disabled || loading" type="submit" class="btn btn-primary btn-block" :class="{'btn-primary': !loading, 'btn-default': loading}"> <button @click.prevent="saveSetup" v-bind:disabled="disabled || loading" type="submit" class="btn btn-primary btn-block" :class="{'btn-primary': !loading, 'btn-default': loading}">
<font-awesome-icon v-if="loading" icon="circle-notch" class="mr-2" spin/>{{loading ? "Loading..." : "Save Settings"}} <font-awesome-icon v-if="loading" icon="circle-notch" class="mr-2" spin/>{{loading ? $t('loading') : $t('save_settings')}}
</button> </button>
</div> </div>
</div> </div>

View File

@ -0,0 +1,77 @@
const chinese = {
settings: "设置",
dashboard: "仪表板",
services: "服务",
service: "服务",
failures: "失败",
users: "用户",
login: "登录",
logout: "注销",
online: "在线",
offline: "离线",
username: "用户名",
password: "密码",
email: "电子邮件",
confirm_password: "确认密码",
uptime: "正常运行时间",
name: "名称",
copy: "复制",
secret: "秘密",
regen_api: "重新生成 API 密钥",
visibility: "可见性",
group: "小组",
groups: "组",
no_group: "无组",
public: "公共",
private: "私人",
announcements: "公告",
notifiers: "通告程序",
logs: "日志",
help: "帮助",
type: "类型",
edit: "编辑",
create: "创建",
view: "查看",
save: "保存",
status: "状态",
total_services: "服务总数",
online_services: "在线服务",
request_timeout: "请求超时",
service_never_online: "服务从未在线",
days_ago: "天前",
today: "今天",
failures_24_hours: "过去 24 小时失败",
no_services: "您目前没有任何服务!",
theme: "主题",
cache: "高速缓存",
authentication: "身份验证",
import: "导入",
main_settings: "主要设置",
variables: "变量",
docs: "文档",
links: "链接",
changelog: "更改日志",
repo: "存储库",
language: "语言",
db_connection: "数据库连接",
db_host: "数据库主机",
db_port: "数据库端口",
db_username: "数据库用户名",
db_password: "数据库口令",
db_database: "数据库名称",
send_reports: "发送错误报告",
project_name: "状态页面名称",
description: "说明",
domain: "域",
newsletter: "新闻通讯",
newsletter_note: "我们只会向您发送重大变更的电子邮件",
loading: "正在加载",
save_settings: "保存设置",
average_response: "平均响应",
last_uptime: "上次正常运行时间",
sign_in: "登录",
failed: "失败",
wrong_login: "用户名或密码不正确"
}
export default chinese

View File

@ -0,0 +1,74 @@
key,en
settings,Settings
dashboard,Dashboard
services,Services
service,Service
failures,Failures
users,Users
login,Login
logout,Logout
online,Online
offline,Offline
username,Username
password,Password
email,Email
confirm_password,Confirm Password
uptime,Uptime
name,Name
copy,Copy
secret,Secret
regen_api,Regenerate API Keys
visibility,Visibility
group,Group
groups,Groups
no_group,No Group
public,Public
private,Private
announcements,Announcements
notifiers,Notifiers
logs,Logs
help,Help
type,Type
edit,Edit
create,Create
view,View
save,Save
status,Status
total_services,Total Services
online_services,Online Services
request_timeout,Request Timeout
service_never_online,Service has never been online
days_ago,Days Ago
today,Today
failures_24_hours,Failures last 24 hours
no_services,You currently don't have any services!
theme,Theme
cache,Cache
authentication,Authentication
import,Import
main_settings,Main Settings
variables,Variables
docs,Documentation
links,Links
changelog,Change Log
repo,Repository
language,Language
db_connection,Database Connection
db_host,Database Host
db_port,Database Port
db_username,Database Username
db_password,Database Password
db_database,Database Name
send_reports,Send Error Reports
project_name,Status Page Name
description,Description
domain,Domain
newsletter,Newsletter
newsletter_note,We will only send you an email for major changes
loading,Loading
save_settings,Save Settings
average_response,Average Response
last_uptime,Uptime last
sign_in,Sign In
failed,Failed
wrong_login,Incorrect username or password
1 key en
2 settings Settings
3 dashboard Dashboard
4 services Services
5 service Service
6 failures Failures
7 users Users
8 login Login
9 logout Logout
10 online Online
11 offline Offline
12 username Username
13 password Password
14 email Email
15 confirm_password Confirm Password
16 uptime Uptime
17 name Name
18 copy Copy
19 secret Secret
20 regen_api Regenerate API Keys
21 visibility Visibility
22 group Group
23 groups Groups
24 no_group No Group
25 public Public
26 private Private
27 announcements Announcements
28 notifiers Notifiers
29 logs Logs
30 help Help
31 type Type
32 edit Edit
33 create Create
34 view View
35 save Save
36 status Status
37 total_services Total Services
38 online_services Online Services
39 request_timeout Request Timeout
40 service_never_online Service has never been online
41 days_ago Days Ago
42 today Today
43 failures_24_hours Failures last 24 hours
44 no_services You currently don't have any services!
45 theme Theme
46 cache Cache
47 authentication Authentication
48 import Import
49 main_settings Main Settings
50 variables Variables
51 docs Documentation
52 links Links
53 changelog Change Log
54 repo Repository
55 language Language
56 db_connection Database Connection
57 db_host Database Host
58 db_port Database Port
59 db_username Database Username
60 db_password Database Password
61 db_database Database Name
62 send_reports Send Error Reports
63 project_name Status Page Name
64 description Description
65 domain Domain
66 newsletter Newsletter
67 newsletter_note We will only send you an email for major changes
68 loading Loading
69 save_settings Save Settings
70 average_response Average Response
71 last_uptime Uptime last
72 sign_in Sign In
73 failed Failed
74 wrong_login Incorrect username or password

View File

@ -1,103 +1,77 @@
const english = { const english = {
top_nav: { settings: "Settings",
dashboard: "Dashboard", dashboard: "Dashboard",
services: "Services", services: "Services",
service: "Service",
failures: "Failures",
users: "Users", users: "Users",
login: "Login",
logout: "Logout",
online: "Online",
offline: "Offline",
username: "Username",
password: "Password",
email: "Email",
confirm_password: "Confirm Password",
uptime: "Uptime",
name: "Name",
copy: "Copy",
secret: "Secret",
regen_api: "Regenerate API Keys",
visibility: "Visibility",
group: "Group",
groups: "Groups", groups: "Groups",
no_group: "No Group",
public: "Public",
private: "Private",
announcements: "Announcements", announcements: "Announcements",
settings: "Settings", notifiers: "Notifiers",
logs: "Logs", logs: "Logs",
help: "Help", help: "Help",
logout: 'Logout', type: "Type",
}, edit: "Edit",
setup: { create: "Create",
language: "Language", view: "View",
connection: "Database Connection", save: "Save",
host: "Host", status: "Status",
database: "Database",
project_name: "Project Name",
project_description: "Project Description",
domain: "Domain URL",
username: "Admin Username",
password: "Admin Password",
password_confirm: "Confirm Admin Password",
newsletter: "Newsletter",
newsletter_note: "We will not share your email, emails are only for major updates.",
send_reports: "Send Error Reports to Statping"
},
dashboard: {
total_services: "Total Services", total_services: "Total Services",
failures_24_hours: "Failures last 24 Hours",
online_services: "Online Services", online_services: "Online Services",
service: 'Service | Services', request_timeout: "Request Timeout",
group: 'Group', service_never_online: "Service has never been online",
title: 'Title', days_ago: "Days Ago",
begins: 'Begins', today: "Today",
name: 'Name', failures_24_hours: "Failures last 24 hours",
loading: 'Loading', no_services: "You currently don't have any services!",
login: 'Login', theme: "Theme",
sign_in: "Sign In",
visibility: 'Visibility',
wrong_login: 'Incorrect username or password'
},
settings: {
name: "Site Name",
description: "Site Description",
footer: "Custom Footer",
footer_notes: "HTML is allowed inside the footer",
error_reporting: "Enable Error Reporting",
error_reporting_notes: "Help the Statping project out by sending anonymous error logs back to our server.",
save: "Save Settings",
main: "Main Settings",
theme: "Theme Editor",
cache: "Cache", cache: "Cache",
oauth: "OAuth", authentication: "Authentication",
import: "Import & Export", import: "Import",
export: "Export", main_settings: "Main Settings",
beta: "BETA", variables: "Variables",
changelog: "Changelog",
repo: "Statping Github Repo",
docs: "Documentation", docs: "Documentation",
}, links: "Links",
service: { changelog: "Change Log",
name: "Service Name", repo: "Repository",
type: "Service Type", language: "Language",
info: "Service Information", db_connection: "Database Connection",
view: "View Service", db_host: "Database Host",
average: "Average Response", db_port: "Database Port",
last_uptime: "Uptime last {0} {1}", db_username: "Database Username",
}, db_password: "Database Password",
email: "Email Address", db_database: "Database Name",
port: "Database Port", send_reports: "Send Error Reports",
setting: "Settings", project_name: "Status Page Name",
username: "Username", description: "Description",
password: 'Password', domain: "Domain",
services: 'Services', newsletter: "Newsletter",
domain: 'Domain', newsletter_note: "We will only send you an email for major changes",
online: 'online', loading: "Loading",
public: 'Public', save_settings: "Save Settings",
private: 'Private', average_response: "Average Response",
admin: 'Admin', last_uptime: "Uptime last",
offline: 'offline', sign_in: "Sign In",
failure: 'failure | failures', failed: "Failed",
incident: 'incident | incidents', wrong_login: "Incorrect username or password"
checkin: 'checkin | checkins',
user: 'User | Users',
group: 'Group',
message: 'message',
edit: 'Edit',
type: 'Type',
sample_data: 'Sample Data',
today: 'Today',
last_login: 'Last Login',
uptime: '{0}% Uptime',
close: 'Close',
second: 'second | seconds',
minute: 'minute | minutes',
hour: 'hour | hours',
day: 'day | days',
week: 'week | weeks',
month: 'month | months',
} }
export default english export default english

View File

@ -1,101 +1,77 @@
const french = { const french = {
top_nav: { settings: "Paramètres",
dashboard: "Dashboard", dashboard: "Tableau de bord",
services: "Services", services: "Services",
users: "Users", service: "Service",
groups: "Groups", failures: "Échecs",
announcements: "Announcements", users: "Utilisateurs",
settings: "Settings", login: "Identifiant",
logs: "Logs", logout: "Déconnexion",
help: "Help", online: "En ligne",
logout: 'Logout', offline: "Offline",
}, username: "Nom d'utilisateur",
setup: { password: "mot de passe",
language: "Language", email: "Email",
connection: "Database Connection", confirm_password: "Confirmer le",
host: "Host", uptime: "Temps de disponibilité",
database: "Database", name: "Nom",
project_name: "Project Name", copy: "Copie",
project_description: "Project Description", secret: "Secret",
domain: "Domain URL", regen_api: "Régénérer les clés d'API",
username: "Admin Username", visibility: "Visibilité",
password: "Admin Password", group: "Groupe",
password_confirm: "Confirm Admin Password", groups: "Groupes",
newsletter: "Newsletter", no_group: "Pas de groupe",
newsletter_note: "We will not share your email, emails are only for major updates.", public: "Publique",
send_reports: "Send Error Reports to Statping" private: "Privé",
}, announcements: "Annonces",
dashboard: { notifiers: "Notifiants",
total_services: "Total Services", logs: "Journaux",
failures_24_hours: "Failures last 24 Hours", help: "Aider",
online_services: "Online Services", type: "Type",
service: 'Service | Services', edit: "Éditer",
group: 'Group', create: "Créer",
title: 'Title', view: "Voir",
begins: 'Begins', save: "Sauvegarder",
name: 'Name', status: "Statut",
loading: 'Loading', total_services: "Total des services",
login: 'Login', online_services: "Services en ligne",
sign_in: "Sign In", request_timeout: "Délai d'attente de",
visibility: 'Visibility', service_never_online: "Le service n'a jamais été en ligne",
wrong_login: 'Incorrect username or password' days_ago: "Il y a jours",
}, today: "Aujourd'hui",
settings: { failures_24_hours: "Les échecs durent 24 heures",
name: "Project Name", no_services: "Vous n'avez actuellement aucun service !",
description: "Project Name", theme: "Thème",
footer: "Custom Footer",
footer_notes: "HTML is allowed inside the footer",
error_reporting: "Enable Error Reporting",
error_reporting_notes: "Help the Statping project out by sending anonymous error logs back to our server.",
save: "Save Settings",
main: "Main Settings",
theme: "Theme Editor",
cache: "Cache", cache: "Cache",
oauth: "OAuth", authentication: "Authentification",
beta: "BETA", import: "Importer",
changelog: "Changelog", main_settings: "Paramètres principaux",
repo: "Statping Github Repo", variables: "Variables",
docs: "Documentation", docs: "Documentation",
}, links: "Links",
service: { changelog: "Journal des modifications",
name: "Service Name", repo: "Référentiel",
type: "Service Type", language: "Langue",
info: "Service Information", db_connection: "Connexion à la base",
view: "View Service", db_host: "Hôte de base",
average: "Average Response", db_port: "Port base de données",
last_uptime: "Uptime last {0} {1}", db_username: "Nom utilisateur de base",
}, db_password: "Mot de passe",
email: "Email Address", db_database: "Nom de la base",
port: "Database Port", send_reports: "Envoyer des rapports d'erreurs",
setting: "Settings", project_name: "Nom de la page d'état",
username: "Username", description: "Description",
password: 'Password', domain: "Domaine",
services: 'Services', newsletter: "Bulletin",
domain: 'Domain', newsletter_note: "Nous ne vous enverrons qu'un e-mail pour les modifications majeures",
online: 'online', loading: "Chargement",
public: 'Public', save_settings: "Enregistrer les paramètres",
private: 'Private', average_response: "Réponse moyenne",
admin: 'Admin', last_uptime: "Temps de disponibilité dernier",
offline: 'offline', sign_in: "Se connecter",
failure: 'failure | failures', failed: "Échec",
incident: 'incident | incidents', wrong_login: "Nom d'utilisateur ou mot de passe"
checkin: 'checkin | checkins',
user: 'User | Users',
group: 'Group',
message: 'message',
edit: 'Edit',
type: 'Type',
sample_data: 'Sample Data',
today: 'Today',
last_login: 'Last Login',
uptime: '{0}% Uptime',
close: 'Close',
second: 'second | seconds',
minute: 'minute | minutes',
hour: 'hour | hours',
day: 'day | days',
week: 'week | weeks',
month: 'month | months',
} }
export default french export default french

View File

@ -1,101 +1,77 @@
const german = { const german = {
top_nav: { settings: "Einstellungen",
dashboard: "Dashboard", dashboard: "Armaturenbrett",
services: "Services", services: "Dienstleistungen",
users: "Users", service: "Service",
groups: "Groups", failures: "Ausfälle",
announcements: "Announcements", users: "Benutzer",
settings: "Settings", login: "Login",
logs: "Logs", logout: "Abmelden",
help: "Help", online: "Online",
logout: 'Logout', offline: "Offline",
}, username: "Benutzername",
setup: { password: "Kennwort",
language: "Language", email: "Mail",
connection: "Database Connection", confirm_password: "Passwort bestätigen",
host: "Host", uptime: "Betriebszeit",
database: "Database", name: "Name",
project_name: "Project Name", copy: "Kopie",
project_description: "Project Description", secret: "Geheimnis",
domain: "Domain URL", regen_api: "API-Schlüssel neu generieren",
username: "Admin Username", visibility: "Sichtbarkeit",
password: "Admin Password", group: "Gruppe",
password_confirm: "Confirm Admin Password", groups: "Gruppen",
newsletter: "Newsletter", no_group: "Keine Gruppe",
newsletter_note: "We will not share your email, emails are only for major updates.", public: "Öffentlichkeit",
send_reports: "Send Error Reports to Statping" private: "Privat",
}, announcements: "Ankündigungen",
dashboard: { notifiers: "Notifizierer",
total_services: "Total Services", logs: "Protokolle",
failures_24_hours: "Failures last 24 Hours", help: "Helfen",
online_services: "Online Services", type: "Typ",
service: 'Service | Services', edit: "Bearbeiten",
group: 'Group', create: "Schaffen",
title: 'Title', view: "Ansicht",
begins: 'Begins', save: "sparen",
name: 'Name', status: "Status",
loading: 'Loading', total_services: "Dienstleistungen insgesamt",
login: 'Login', online_services: "Online-Dienste",
sign_in: "Sign In", request_timeout: "Zeitüberschreitung anfordern",
visibility: 'Visibility', service_never_online: "Service war noch nie online",
wrong_login: 'Incorrect username or password' days_ago: "Vor Tagen",
}, today: "Heute",
settings: { failures_24_hours: "Ausfälle dauern 24 Stunden",
name: "Project Name", no_services: "Sie haben derzeit keine Dienste!",
description: "Project Name", theme: "Thema",
footer: "Custom Footer",
footer_notes: "HTML is allowed inside the footer",
error_reporting: "Enable Error Reporting",
error_reporting_notes: "Help the Statping project out by sending anonymous error logs back to our server.",
save: "Save Settings",
main: "Main Settings",
theme: "Theme Editor",
cache: "Cache", cache: "Cache",
oauth: "OAuth", authentication: "Authentifikation",
beta: "BETA", import: "Importieren",
changelog: "Changelog", main_settings: "Haupteinstellungen",
repo: "Statping Github Repo", variables: "Variablen",
docs: "Documentation", docs: "Dokumentation",
}, links: "Links",
service: { changelog: "Protokoll ändern",
name: "Service Name", repo: "Depot",
type: "Service Type", language: "Sprache",
info: "Service Information", db_connection: "Datenbankverbindung",
view: "View Service", db_host: "Datenbank-Host",
average: "Average Response", db_port: "Datenbank-Port",
last_uptime: "Uptime last {0} {1}", db_username: "Datenbank-Benutzername",
}, db_password: "Datenbank-Kennwort",
email: "Email Address", db_database: "Name der Datenbank",
port: "Database Port", send_reports: "Fehlerberichte senden",
setting: "Settings", project_name: "Name der Seite „Status“",
username: "Username", description: "Beschreibung",
password: 'Password', domain: "Domäne",
services: 'Services', newsletter: "Newsletter",
domain: 'Domain', newsletter_note: "Wir senden Ihnen nur eine E-Mail für größere Änderungen",
online: 'online', loading: "Laden",
public: 'Public', save_settings: "Einstellungen speichern",
private: 'Private', average_response: "Durchschnittliche Antwort",
admin: 'Admin', last_uptime: "Betriebszeit zuletzt",
offline: 'offline', sign_in: "Anmelden",
failure: 'failure | failures', failed: "Fehlgeschlagen",
incident: 'incident | incidents', wrong_login: "Falscher Benutzername oder Passwort"
checkin: 'checkin | checkins',
user: 'User | Users',
group: 'Group',
message: 'message',
edit: 'Edit',
type: 'Type',
sample_data: 'Sample Data',
today: 'Today',
last_login: 'Last Login',
uptime: '{0}% Uptime',
close: 'Close',
second: 'second | seconds',
minute: 'minute | minutes',
hour: 'hour | hours',
day: 'day | days',
week: 'week | weeks',
month: 'month | months',
} }
export default german export default german

View File

@ -3,6 +3,10 @@ import spanish from "./spanish"
import german from "./german" import german from "./german"
import russian from "./russian"; import russian from "./russian";
import french from "./french"; import french from "./french";
import japanese from "./japanese";
import chinese from "./chinese";
import korean from "./korean";
import italian from "./italian";
const language = { const language = {
en: english, en: english,
@ -10,6 +14,10 @@ const language = {
de: german, de: german,
ru: russian, ru: russian,
fr: french, fr: french,
ja: japanese,
zh: chinese,
ko: korean,
it: italian,
} }
export default language export default language

View File

@ -0,0 +1,77 @@
const italian = {
settings: "Impostazioni",
dashboard: "cruscotto",
services: "Servizi",
service: "Servizio",
failures: "Fallimenti",
users: "Utenti",
login: "Login",
logout: "Disconnetti",
online: "Online",
offline: "Offline",
username: "Nome utente",
password: "Password",
email: "E-mail",
confirm_password: "Conferma password",
uptime: "Tempi di attività",
name: "Nome",
copy: "Copia",
secret: "Segreto",
regen_api: "Rigenera chiavi API",
visibility: "Visibilità",
group: "Gruppo",
groups: "Gruppi",
no_group: "Nessun gruppo",
public: "Pubblico",
private: "Privato",
announcements: "Comunicazioni",
notifiers: "Notificatori",
logs: "Log",
help: "Guida",
type: "Tipo",
edit: "Modifica",
create: "Crea",
view: "Visualizza",
save: "Salvare",
status: "Stato",
total_services: "Totale servizi",
online_services: "Servizi online",
request_timeout: "Timeout richiesta",
service_never_online: "Il servizio non è mai stato online",
days_ago: "Giorni fa",
today: "Oggi",
failures_24_hours: "Errori nelle ultime 24 ore",
no_services: "Al momento non hai alcun servizio!",
theme: "Tema",
cache: "Cache",
authentication: "autenticazione",
import: "Importa",
main_settings: "Impostazioni principali",
variables: "Variabili",
docs: "Documentazione",
links: "Collegamenti",
changelog: "Registro delle modifiche",
repo: "repository",
language: "Lingua",
db_connection: "Connessione al database",
db_host: "Host del database",
db_port: "Porta del database",
db_username: "Nome utente del database",
db_password: "Password del database",
db_database: "Nome database",
send_reports: "Invia segnalazioni errori",
project_name: "Nome pagina di stato",
description: "Descrizione",
domain: "Dominio",
newsletter: "Bollettino",
newsletter_note: "Ti invieremo solo una e-mail per le modifiche più importanti",
loading: "Caricamento",
save_settings: "Salva impostazioni",
average_response: "Risposta media",
last_uptime: "Ultimo tempo di attività",
sign_in: "Accedi",
failed: "Non riuscito",
wrong_login: "Nome utente o password non corretti"
}
export default italian

View File

@ -0,0 +1,77 @@
const japanese = {
settings: "設定",
dashboard: "ダッシュボード",
services: "サービス",
service: "サービス",
failures: "障害",
users: "ユーザー",
login: "ログイン",
logout: "ログアウト",
online: "オンライン",
offline: "オフライン",
username: "ユーザ名",
password: "パスワード",
email: "Eメール",
confirm_password: "パスワードの確認",
uptime: "稼働時間",
name: "氏名",
copy: "コピー",
secret: "秘密",
regen_api: "API キーの再生成",
visibility: "可視性",
group: "グループ",
groups: "グループ",
no_group: "グループなし",
public: "パブリック",
private: "私立",
announcements: "アナウンス",
notifiers: "通知者",
logs: "ログ",
help: "ヘルプ",
type: "タイプ",
edit: "編集",
create: "作成",
view: "ビュー",
save: "保存する",
status: "ステータス",
total_services: "トータルサービス",
online_services: "オンラインサービス",
request_timeout: "リクエストのタイムアウト",
service_never_online: "サービスがオンラインになったことがない",
days_ago: "日前",
today: "今日",
failures_24_hours: "過去 24 時間の障害",
no_services: "現在、サービスをお持ちになりません。",
theme: "テーマ",
cache: "キャッシュ",
authentication: "認証",
import: "インポート",
main_settings: "メイン設定",
variables: "変数",
docs: "ドキュメント",
links: "リンク",
changelog: "変更ログ",
repo: "リポジトリ",
language: "言語",
db_connection: "データベース接続",
db_host: "データベース・ホスト",
db_port: "データベースポート",
db_username: "データベースのユーザー名",
db_password: "データベースパスワード",
db_database: "データベース名",
send_reports: "エラーレポートを送信",
project_name: "ステータスページ名",
description: "説明",
domain: "ドメイン",
newsletter: "ニュースレター",
newsletter_note: "大きな変更についてのみメールをお送りします",
loading: "ロード中",
save_settings: "設定を保存",
average_response: "平均応答",
last_uptime: "稼働時間最後",
sign_in: "サインイン",
failed: "失敗しました",
wrong_login: "ユーザー名またはパスワードが正しくありません"
}
export default japanese

View File

@ -0,0 +1,77 @@
const korean = {
settings: "설정",
dashboard: "대시보드",
services: "서비스",
service: "서비스",
failures: "장애",
users: "사용자",
login: "로그인",
logout: "로그아웃",
online: "온라인",
offline: "오프라인",
username: "사용자 이름",
password: "비밀번호",
email: "이메일",
confirm_password: "비밀번호 확인",
uptime: "가동 시간",
name: "이름",
copy: "복사",
secret: "비밀",
regen_api: "API 키 재생성",
visibility: "가시성",
group: "그룹",
groups: "그룹",
no_group: "그룹 없음",
public: "공공",
private: "비공개",
announcements: "공지사항",
notifiers: "통지자",
logs: "로그",
help: "도움말",
type: "유형",
edit: "편집",
create: "만들기",
view: "보기",
save: "저장",
status: "상태",
total_services: "총 서비스",
online_services: "온라인 서비스",
request_timeout: "요청 시간 초과",
service_never_online: "서비스는 온라인 적이 없습니다",
days_ago: "일 전",
today: "오늘",
failures_24_hours: "지난 24시간 동안 장애 발생",
no_services: "현재 서비스가 없습니다!",
theme: "테마",
cache: "캐시",
authentication: "인증",
import: "가져오기",
main_settings: "주 설정",
variables: "변수",
docs: "설명서",
links: "링크",
changelog: "변경 로그",
repo: "저장소",
language: "언어",
db_connection: "데이터베이스 연결",
db_host: "데이터베이스 호스트",
db_port: "데이터베이스 포트",
db_username: "데이터베이스 사용자 이름",
db_password: "데이터베이스 암호",
db_database: "데이터베이스 이름",
send_reports: "오류 보고서 보내기",
project_name: "상태 페이지 이름",
description: "설명",
domain: "도메인",
newsletter: "신제품",
newsletter_note: "주요 변경 사항에 대한 이메일만 보내드립니다.",
loading: "로드 중",
save_settings: "설정 저장",
average_response: "평균 응답",
last_uptime: "마지막 가동 시간",
sign_in: "로그인",
failed: "실패",
wrong_login: "잘못된 사용자 이름 또는 암호"
}
export default korean

View File

@ -1,101 +1,77 @@
const russian = { const russian = {
top_nav: { settings: "Настройки",
dashboard: "Dashboard", dashboard: "Панель управления",
services: "Services", services: "служб",
users: "Users", service: "обслуживания",
groups: "Groups", failures: "Сбои",
announcements: "Announcements", users: "Пользователи",
settings: "Settings", login: "Войти",
logs: "Logs", logout: "Выход из системы",
help: "Help", online: "Онлайн",
logout: 'Logout', offline: "Оффлайн",
}, username: "Имя пользователя",
setup: { password: "Пароль",
language: "Language", email: "Электронная почта",
connection: "Database Connection", confirm_password: "Подтвердить пароль",
host: "Host", uptime: "Время бесперебойной работы",
database: "Database", name: "Имя",
project_name: "Project Name", copy: "Копия",
project_description: "Project Description", secret: "Секрет",
domain: "Domain URL", regen_api: "Регенерация ключей API",
username: "Admin Username", visibility: "Видимость",
password: "Admin Password", group: "Группы",
password_confirm: "Confirm Admin Password", groups: "Группы",
newsletter: "Newsletter", no_group: "Нет группы",
newsletter_note: "We will not share your email, emails are only for major updates.", public: "Общественный",
send_reports: "Send Error Reports to Statping" private: "Частные",
}, announcements: "Объявления",
dashboard: { notifiers: "Уведомлятели",
total_services: "Total Services", logs: "Журналы",
failures_24_hours: "Failures last 24 Hours", help: "Помогите",
online_services: "Online Services", type: "Тип",
service: 'Service | Services', edit: "Редактировать",
group: 'Group', create: "Создайте",
title: 'Title', view: "Посмотреть",
begins: 'Begins', save: "Сохранить",
name: 'Name', status: "положению",
loading: 'Loading', total_services: "Всего услуг",
login: 'Login', online_services: "Онлайн-сервисы",
sign_in: "Sign In", request_timeout: "Тайм-аут запроса",
visibility: 'Visibility', service_never_online: "Сервис никогда не был в сети",
wrong_login: 'Incorrect username or password' days_ago: "Дней назад",
}, today: "Сегодня",
settings: { failures_24_hours: "Сбои за 24 часа",
name: "Project Name", no_services: "В настоящее время у вас нет услуг!",
description: "Project Name", theme: "Тема",
footer: "Custom Footer", cache: "Кэш",
footer_notes: "HTML is allowed inside the footer", authentication: "Проверка подлинности",
error_reporting: "Enable Error Reporting", import: "Импорт",
error_reporting_notes: "Help the Statping project out by sending anonymous error logs back to our server.", main_settings: "Основные настройки",
save: "Save Settings", variables: "Переменные",
main: "Main Settings", docs: "Документация",
theme: "Theme Editor", links: "Ссылки",
cache: "Cache", changelog: "Журнал изменений",
oauth: "OAuth", repo: "Репозиторий",
beta: "BETA", language: "Язык",
changelog: "Changelog", db_connection: "Подключение к базе данных",
repo: "Statping Github Repo", db_host: "Узел базы данных",
docs: "Documentation", db_port: "Порт базы данных",
}, db_username: "Имя пользователя базы данных",
service: { db_password: "Пароль базы данных",
name: "Service Name", db_database: "Имя базы данных",
type: "Service Type", send_reports: "Отправка отчетов об ошибках",
info: "Service Information", project_name: "Имя страницы состояния",
view: "View Service", description: "Описание",
average: "Average Response", domain: "Домен",
last_uptime: "Uptime last {0} {1}", newsletter: "Информационный бюллетень",
}, newsletter_note: "Мы отправим вам только сообщение по электронной почте для серьезных изменений",
email: "Email Address", loading: "Загрузка",
port: "Database Port", save_settings: "Сохранить настройки",
setting: "Settings", average_response: "Средний ответ",
username: "Username", last_uptime: "Время безотказной работы",
password: 'Password', sign_in: "Войти",
services: 'Services', failed: "Не удалось",
domain: 'Domain', wrong_login: "Неверное имя пользователя или пароль"
online: 'онлайн',
public: 'Public',
private: 'Private',
admin: 'Admin',
offline: 'не в сети',
failure: 'failure | failures',
incident: 'incident | incidents',
checkin: 'checkin | checkins',
user: 'User | Users',
group: 'Group',
message: 'message',
edit: 'Edit',
type: 'Type',
sample_data: 'Sample Data',
today: 'Today',
last_login: 'Last Login',
uptime: '{0}% Uptime',
close: 'близко',
second: 'второй | секунд',
minute: 'минут | минут',
hour: 'час | часов',
day: 'день | дней',
week: 'неделя | недель',
month: 'месяц | месяцы',
} }
export default russian export default russian

View File

@ -1,101 +1,77 @@
const spanish = { const spanish = {
top_nav: { settings: "Configuración",
dashboard: "Dashboard", dashboard: "Salpicadero",
services: "Services", services: "Servicios",
users: "Users", service: "Servicio",
groups: "Groups", failures: "Fallos",
announcements: "Announcements", users: "Usuarios",
settings: "Settings", login: "Iniciar sesión",
logs: "Logs", logout: "Cerrar sesión",
help: "Help", online: "En línea",
logout: 'Logout', offline: "Offline",
}, username: "Nombre de usuario",
setup: { password: "Contraseña",
language: "Language", email: "Correo",
connection: "Database Connection", confirm_password: "Confirmar contraseña",
host: "Host", uptime: "Tiempo de actividad",
database: "Database", name: "Nombre",
project_name: "Project Name", copy: "Copia",
project_description: "Project Description", secret: "Secreto",
domain: "Domain URL", regen_api: "Regenerar claves de API",
username: "Admin Username", visibility: "Visibilidad",
password: "Admin Password", group: "Grupo",
password_confirm: "Confirm Admin Password", groups: "Grupos",
no_group: "Ningún grupo",
public: "Público",
private: "Privado",
announcements: "Anuncios",
notifiers: "Notificadores",
logs: "Registros",
help: "Ayudar",
type: "Tipo",
edit: "Editar",
create: "Crear",
view: "Ver",
save: "Guardar",
status: "Estado",
total_services: "Total de servicios",
online_services: "Servicios en línea",
request_timeout: "Tiempo de espera de solicitud",
service_never_online: "El servicio nunca ha estado en línea",
days_ago: "Hace días",
today: "Hoy",
failures_24_hours: "Fallos de las últimas 24 horas",
no_services: "¡Actualmente no tienes ningún servicio!",
theme: "Tema",
cache: "Caché",
authentication: "Autentificación",
import: "Importación",
main_settings: "Configuración principal",
variables: "Variables",
docs: "Documentación",
links: "Enlaces",
changelog: "Registro de cambios",
repo: "Repositorio",
language: "Idioma",
db_connection: "Conexión a la base",
db_host: "Host de base",
db_port: "Puerto base de datos",
db_username: "Nombre de usuario de",
db_password: "Contraseña",
db_database: "Nombre de la base",
send_reports: "Enviar informes de errores",
project_name: "Nombre de página de estado",
description: "Descripción",
domain: "Dominio",
newsletter: "Newsletter", newsletter: "Newsletter",
newsletter_note: "We will not share your email, emails are only for major updates.", newsletter_note: "Sólo le enviaremos un correo electrónico para cambios importantes",
send_reports: "Send Error Reports to Statping" loading: "Cargando",
}, save_settings: "Guardar configuración",
dashboard: { average_response: "Respuesta media",
total_services: "Total Services", last_uptime: "Tiempo de actividad último",
failures_24_hours: "Failures last 24 Hours", sign_in: "Iniciar sesión",
online_services: "Online Services", failed: "Falló",
service: 'Service | Services', wrong_login: "Nombre de usuario o contraseña incorrectos"
group: 'Group',
title: 'Title',
begins: 'Begins',
name: 'Name',
loading: 'Loading',
login: 'Login',
sign_in: "Sign In",
visibility: 'Visibility',
wrong_login: 'Incorrect username or password'
},
settings: {
name: "Project Name",
description: "Project Name",
footer: "Custom Footer",
footer_notes: "HTML is allowed inside the footer",
error_reporting: "Enable Error Reporting",
error_reporting_notes: "Help the Statping project out by sending anonymous error logs back to our server.",
save: "Save Settings",
main: "Main Settings",
theme: "Theme Editor",
cache: "Cache",
oauth: "OAuth",
beta: "BETA",
changelog: "Changelog",
repo: "Statping Github Repo",
docs: "Documentation",
},
service: {
name: "Service Name",
type: "Service Type",
info: "Service Information",
view: "View Service",
average: "Average Response",
last_uptime: "Uptime last {0} {1}",
},
email: "Email Address",
port: "Database Port",
setting: "Settings",
username: "Username",
password: 'Password',
services: 'Services',
domain: 'Domain',
online: 'online',
public: 'Public',
private: 'Private',
admin: 'Admin',
offline: 'offline',
failure: 'failure | failures',
incident: 'incident | incidents',
checkin: 'checkin | checkins',
user: 'User | Users',
group: 'Group',
message: 'message',
edit: 'Edit',
type: 'Type',
sample_data: 'Sample Data',
today: 'Today',
last_login: 'Last Login',
uptime: '{0}% Uptime',
close: 'Close',
second: 'second | seconds',
minute: 'minute | minutes',
hour: 'hour | hours',
day: 'day | days',
week: 'week | weeks',
month: 'month | months',
} }
export default spanish export default spanish

View File

@ -110,7 +110,7 @@ export default Vue.mixin({
return `Offline, last error: ${last} ${this.ago(last.created_at)}` return `Offline, last error: ${last} ${this.ago(last.created_at)}`
} }
if (this.isZero(s.last_success)) { if (this.isZero(s.last_success)) {
return `Service has never been online` return this.$t('service_never_online')
} }
return `Service has been offline for ${this.ago(s.last_success)}` return `Service has been offline for ${this.ago(s.last_success)}`
} }

View File

@ -10,25 +10,25 @@
<a href="https://github.com/statping/statping/blob/master/CHANGELOG.md" class="btn btn-sm text-dim mt-2">Changelog</a> <a href="https://github.com/statping/statping/blob/master/CHANGELOG.md" class="btn btn-sm text-dim mt-2">Changelog</a>
</div> </div>
<h6 class="text-muted">{{ $t('settings.main') }}</h6> <h6 class="text-muted">{{ $t('main_settings') }}</h6>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-home-tab')}" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true"> <a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-home-tab')}" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">
<font-awesome-icon icon="cog" class="mr-2"/> {{ $t('setting') }} <font-awesome-icon icon="cog" class="mr-2"/> {{ $t('settings') }}
</a> </a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-style-tab')}" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false"> <a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-style-tab')}" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false">
<font-awesome-icon icon="image" class="mr-2"/> {{ $t('settings.theme') }} <font-awesome-icon icon="image" class="mr-2"/> {{ $t('theme') }}
</a> </a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-cache-tab')}" id="v-pills-cache-tab" data-toggle="pill" href="#v-pills-cache" role="tab" aria-controls="v-pills-cache" aria-selected="false"> <a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-cache-tab')}" id="v-pills-cache-tab" data-toggle="pill" href="#v-pills-cache" role="tab" aria-controls="v-pills-cache" aria-selected="false">
<font-awesome-icon icon="paperclip" class="mr-2"/> {{ $t('settings.cache') }} <font-awesome-icon icon="paperclip" class="mr-2"/> {{ $t('cache') }}
</a> </a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-oauth-tab')}" id="v-pills-oauth-tab" data-toggle="pill" href="#v-pills-oauth" role="tab" aria-controls="v-pills-oauth" aria-selected="false"> <a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-oauth-tab')}" id="v-pills-oauth-tab" data-toggle="pill" href="#v-pills-oauth" role="tab" aria-controls="v-pills-oauth" aria-selected="false">
<font-awesome-icon icon="key" class="mr-2"/> {{ $t('settings.oauth') }} <font-awesome-icon icon="key" class="mr-2"/> {{ $t('authentication') }}
</a> </a>
<a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-import-tab')}" id="v-pills-import-tab" data-toggle="pill" href="#v-pills-import" role="tab" aria-controls="v-pills-import" aria-selected="false"> <a @click.prevent="changeTab" class="nav-link" v-bind:class="{active: liClass('v-pills-import-tab')}" id="v-pills-import-tab" data-toggle="pill" href="#v-pills-import" role="tab" aria-controls="v-pills-import" aria-selected="false">
<font-awesome-icon icon="cloud-download-alt" class="mr-2"/> {{ $t('settings.import') }} <font-awesome-icon icon="cloud-download-alt" class="mr-2"/> {{ $t('import') }}
</a> </a>
<h6 class="mt-4 text-muted">Notifiers</h6> <h6 class="mt-4 text-muted">{{$t('notifiers')}}</h6>
<div id="notifiers_tabs"> <div id="notifiers_tabs">
<a v-for="(notifier, index) in notifiers" v-bind:key="`${notifier.method}`" @click.prevent="changeTab" class="nav-link text-capitalize" v-bind:class="{active: liClass(`v-pills-${notifier.method.toLowerCase()}-tab`)}" v-bind:id="`v-pills-${notifier.method.toLowerCase()}-tab`" data-toggle="pill" v-bind:href="`#v-pills-${notifier.method.toLowerCase()}`" role="tab" v-bind:aria-controls="`v-pills-${notifier.method.toLowerCase()}`" aria-selected="false"> <a v-for="(notifier, index) in notifiers" v-bind:key="`${notifier.method}`" @click.prevent="changeTab" class="nav-link text-capitalize" v-bind:class="{active: liClass(`v-pills-${notifier.method.toLowerCase()}-tab`)}" v-bind:id="`v-pills-${notifier.method.toLowerCase()}-tab`" data-toggle="pill" v-bind:href="`#v-pills-${notifier.method.toLowerCase()}`" role="tab" v-bind:aria-controls="`v-pills-${notifier.method.toLowerCase()}`" aria-selected="false">
@ -36,26 +36,26 @@
<span v-if="notifier.enabled" class="badge badge-pill float-right mt-1" :class="{'badge-success': !liClass(`v-pills-${notifier.method.toLowerCase()}-tab`), 'badge-light': liClass(`v-pills-${notifier.method.toLowerCase()}-tab`), 'text-dark': liClass(`v-pills-${notifier.method.toLowerCase()}-tab`)}">ON</span> <span v-if="notifier.enabled" class="badge badge-pill float-right mt-1" :class="{'badge-success': !liClass(`v-pills-${notifier.method.toLowerCase()}-tab`), 'badge-light': liClass(`v-pills-${notifier.method.toLowerCase()}-tab`), 'text-dark': liClass(`v-pills-${notifier.method.toLowerCase()}-tab`)}">ON</span>
</a> </a>
<a @click.prevent="changeTab" class="nav-link text-capitalize" v-bind:class="{active: liClass(`v-pills-notifier-docs-tab`)}" v-bind:id="`v-pills-notifier-docs-tab`" data-toggle="pill" v-bind:href="`#v-pills-notifier-docs`" role="tab" v-bind:aria-controls="`v-pills-notifier-docs`" aria-selected="false"> <a @click.prevent="changeTab" class="nav-link text-capitalize" v-bind:class="{active: liClass(`v-pills-notifier-docs-tab`)}" v-bind:id="`v-pills-notifier-docs-tab`" data-toggle="pill" v-bind:href="`#v-pills-notifier-docs`" role="tab" v-bind:aria-controls="`v-pills-notifier-docs`" aria-selected="false">
<font-awesome-icon icon="question" class="mr-2"/> Variables <font-awesome-icon icon="question" class="mr-2"/> {{$t('variables')}}
</a> </a>
</div> </div>
<h6 class="mt-4 mb-3 text-muted">Statping Links</h6> <h6 class="mt-4 mb-3 text-muted">Statping {{$t('links')}}</h6>
<a href="https://github.com/statping/statping/wiki" class="mb-2 font-2 text-decoration-none text-muted"> <a href="https://github.com/statping/statping/wiki" class="mb-2 font-2 text-decoration-none text-muted">
<font-awesome-icon icon="question" class="mr-3"/> {{$t('settings.docs')}} <font-awesome-icon icon="question" class="mr-3"/> {{$t('docs')}}
</a> </a>
<a href="https://github.com/statping/statping/wiki/API" class="mb-2 font-2 text-decoration-none text-muted"> <a href="https://github.com/statping/statping/wiki/API" class="mb-2 font-2 text-decoration-none text-muted">
<font-awesome-icon icon="laptop" class="mr-2"/> API {{$t('settings.docs')}} <font-awesome-icon icon="laptop" class="mr-2"/> API {{$t('docs')}}
</a> </a>
<a href="https://raw.githubusercontent.com/statping/statping/master/CHANGELOG.md" class="mb-2 font-2 text-decoration-none text-muted"> <a href="https://raw.githubusercontent.com/statping/statping/master/CHANGELOG.md" class="mb-2 font-2 text-decoration-none text-muted">
<font-awesome-icon icon="book" class="mr-3"/> {{$t('settings.changelog')}} <font-awesome-icon icon="book" class="mr-3"/> {{$t('changelog')}}
</a> </a>
<a href="https://github.com/statping/statping" class="mb-2 font-2 text-decoration-none text-muted"> <a href="https://github.com/statping/statping" class="mb-2 font-2 text-decoration-none text-muted">
<font-awesome-icon icon="code-branch" class="mr-3"/> {{$t('settings.repo')}} <font-awesome-icon icon="code-branch" class="mr-3"/> {{$t('repo')}}
</a> </a>
<span class="small text-dim text-center mt-5">Statping v{{core.version}}<br> <span class="small text-dim text-center mt-5">Statping v{{core.version}}<br>
@ -74,15 +74,15 @@
<CoreSettings/> <CoreSettings/>
<div class="card mt-3"> <div class="card mt-3">
<div class="card-header">API Settings</div> <div class="card-header">API {{$t('settings')}}</div>
<div class="card-body"> <div class="card-body">
<div class="form-group row"> <div class="form-group row">
<label class="col-sm-3 col-form-label">API Secret</label> <label class="col-sm-3 col-form-label">API {{$t('secret')}}</label>
<div class="col-sm-9"> <div class="col-sm-9">
<div class="input-group"> <div class="input-group">
<input v-model="core.api_secret" @focus="$event.target.select()" type="text" class="form-control select-input" id="api_secret" readonly> <input v-model="core.api_secret" @focus="$event.target.select()" type="text" class="form-control select-input" id="api_secret" readonly>
<div class="input-group-append copy-btn"> <div class="input-group-append copy-btn">
<button @click="copy(core.api_secret)" class="btn btn-outline-secondary" type="button">Copy</button> <button @click="copy(core.api_secret)" class="btn btn-outline-secondary" type="button">{{$t('copy')}}</button>
</div> </div>
</div> </div>
<small class="form-text text-muted">API Secret is used for read, create, update and delete routes</small> <small class="form-text text-muted">API Secret is used for read, create, update and delete routes</small>
@ -92,7 +92,7 @@
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<button id="regenkeys" @click="renewApiKeys" class="btn btn-sm btn-danger float-right">Regenerate API Keys</button> <button id="regenkeys" @click="renewApiKeys" class="btn btn-sm btn-danger float-right">{{$t('regen_api')}}</button>
</div> </div>
</div> </div>

View File

@ -0,0 +1,227 @@
// +build ignore
package main
import (
"encoding/csv"
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/translate"
"io"
"io/ioutil"
"os"
"strings"
)
var (
tr *translate.Translate
awsKey string
awsSecret string
)
type Text struct {
Key string
En string
Fr string
De string
Ru string
Sp string
Jp string
Cn string
Ko string
It string
}
func Translate(val, language string) string {
input := &translate.TextInput{
SourceLanguageCode: aws.String("en"),
TargetLanguageCode: aws.String(language),
Text: aws.String(val),
}
req, out := tr.TextRequest(input)
if err := req.Send(); err != nil {
panic(req.Error)
}
return *out.TranslatedText
}
func TranslateAll(key, en string) *Text {
return &Text{
Key: key,
En: en,
Fr: Translate(en, "fr"),
De: Translate(en, "de"),
Ru: Translate(en, "ru"),
Sp: Translate(en, "es"),
Jp: Translate(en, "ja"),
Cn: Translate(en, "zh"),
Ko: Translate(en, "ko"),
It: Translate(en, "it"),
}
}
func main() {
fmt.Println("RUNNING: ./source/generate_languages.go")
awsKey = os.Getenv("AWS_ACCESS_KEY_ID")
awsSecret = os.Getenv("AWS_SECRET_ACCESS_KEY")
if awsKey == "" || awsSecret == "" {
fmt.Println("AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY not set")
os.Exit(1)
return
}
InitAWS()
file, _ := os.Open("../frontend/src/languages/data.csv")
defer file.Close()
c := csv.NewReader(file)
var translations []*Text
line := 0
for {
// Read each record from csv
record, err := c.Read()
if err == io.EOF {
break
}
if line == 0 {
line++
continue
}
if err != nil {
fmt.Println(err)
continue
}
key := record[0]
english := record[1]
translated := TranslateAll(key, english)
translations = append(translations, translated)
fmt.Printf("%s | English: %s | French: %s | German: %s | Russian: %s\n", translated.Key, translated.En, translated.Fr, translated.De, translated.Ru)
line++
}
CreateGo(translations)
CreateJS("english", translations)
CreateJS("russian", translations)
CreateJS("french", translations)
CreateJS("german", translations)
CreateJS("spanish", translations)
CreateJS("japanese", translations)
CreateJS("chinese", translations)
CreateJS("italian", translations)
CreateJS("korean", translations)
}
func (t *Text) String(lang string) string {
switch lang {
case "english":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.En)
case "russian":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Ru)
case "spanish":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Sp)
case "german":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.De)
case "french":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Fr)
case "japanese":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Jp)
case "chinese":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Cn)
case "korean":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.Ko)
case "italian":
return fmt.Sprintf(` %s: "%s"`, t.Key, t.It)
default:
return fmt.Sprintf(` %s: "%s"`, t.Key, t.En)
}
}
func GoLang(trs []*Text) string {
var allvars []string
languages := []string{"english", "russian"}
for _, language := range languages {
allvars = append(allvars, language+" := make(map[string]string)")
for _, t := range trs {
allvars = append(allvars, GoLine(language, t))
}
allvars = append(allvars, "\nLanguage[\""+language+"\"] = "+language)
}
return strings.Join(allvars, "\n")
}
func GoLine(lang string, t *Text) string {
switch lang {
case "english":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.En)
case "russian":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Ru)
case "spanish":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Sp)
case "german":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.De)
case "french":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Fr)
case "japanese":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Jp)
case "chinese":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Cn)
case "korean":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.Ko)
case "italian":
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.It)
default:
return fmt.Sprintf(` %s["%s"] = "%s"`, lang, t.Key, t.En)
}
}
func CreateGo(trs []*Text) {
data := `package utils
var Language map[string]map[string]string
func init() {
Language = make(map[string]map[string]string)
` + GoLang(trs) + `
}
`
ioutil.WriteFile("../utils/languages.go", []byte(data), os.ModePerm)
}
func CreateJS(name string, trs []*Text) {
data := "const " + name + " = {\n"
var allvars []string
for _, v := range trs {
allvars = append(allvars, v.String(name))
}
data += strings.Join(allvars, ",\n")
data += "\n}\n\nexport default " + name
ioutil.WriteFile("../frontend/src/languages/"+name+".js", []byte(data), os.ModePerm)
}
func InitAWS() {
creds := credentials.NewStaticCredentials(awsKey, awsSecret, "")
sess, err := session.NewSession(&aws.Config{
Region: aws.String("us-west-2"),
Credentials: creds,
})
if err != nil {
panic(err)
}
tr = translate.New(sess)
}

View File

@ -2,6 +2,7 @@ package source
//go:generate go run generate_help.go //go:generate go run generate_help.go
//go:generate go run generate_version.go //go:generate go run generate_version.go
//go:generate go run generate_languages.go
import ( import (
"fmt" "fmt"