Skip to content

Commit

Permalink
Merge pull request #105 from simahawk/shopfloor-mobile-transl
Browse files Browse the repository at this point in the history
Shopfloor mobile: improve translations
  • Loading branch information
simahawk authored Nov 3, 2020
2 parents 25c1483 + 9353278 commit d1d2157
Show file tree
Hide file tree
Showing 14 changed files with 302 additions and 197 deletions.
2 changes: 1 addition & 1 deletion shopfloor_mobile/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Shopfloor mobile",
"summary": "Mobile frontend for WMS Shopfloor app",
"version": "13.0.1.3.1",
"version": "13.0.1.4.0",
"development_status": "Alpha",
"depends": ["shopfloor"],
"author": "Camptocamp, BCIM, Akretion, Odoo Community Association (OCA)",
Expand Down
28 changes: 17 additions & 11 deletions shopfloor_mobile/static/wms/src/components/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vue.component("reset-screen-button", {
template: `
<div class="action reset" v-if="show_reset_button">
<v-form class="m-t5" v-on:reset="reset">
<v-btn color="warning" x-large @click="reset">Reset</v-btn>
<v-btn color="warning" x-large @click="reset">{{ $t('btn.reset.title') }}</v-btn>
</v-form>
</div>
`,
Expand All @@ -26,7 +26,7 @@ Vue.component("reset-screen-button", {
Vue.component("cancel-button", {
template: `
<div class="action reset">
<v-btn x-large color="error" v-on:click="$emit('cancel')">Cancel</v-btn>
<v-btn x-large color="error" v-on:click="$emit('cancel')">{{ $t('btn.cancel.title') }}</v-btn>
</div>
`,
});
Expand All @@ -46,7 +46,7 @@ Vue.component("last-operation", {
<v-card-text>The next operation is ready to be processed.</v-card-text>
</v-card>
<v-form class="mt-10">
<v-btn x-large color="success" @click="$emit('confirm')">OK</v-btn>
<v-btn x-large color="success" @click="$emit('confirm')">{{ $t('btn.ok.title') }}</v-btn>
</v-form>
</v-alert>
</v-dialog>
Expand All @@ -58,10 +58,10 @@ Vue.component("get-work", {
template: `
<div class="get-work fullscreen-buttons fullscreen-buttons-50">
<btn-action id="btn-get-work" @click="$emit('get_work')">
Get work
{{ $t('misc.btn_get_work') }}
</btn-action>
<btn-action id="btn-manual" color="default" @click="$emit('manual_selection')">
Manual selection
{{ $t('misc.btn_manual_selection') }}
</btn-action>
</div>
`,
Expand All @@ -75,12 +75,16 @@ Vue.component("stock-zero-check", {
<div class="button-list button-vertical-list">
<v-row align="center">
<v-col class="text-center" cols="12">
<v-btn x-large color="primary" @click="$emit('action', 'action_confirm_zero')">Confirm stock = 0</v-btn>
<v-btn x-large color="primary" @click="$emit('action', 'action_confirm_zero')">
{{ $t('misc.stock_zero_check.confirm_stock_zero') }}
</v-btn>
</v-col>
</v-row>
<v-row align="center">
<v-col class="text-center" cols="12">
<v-btn x-large color="warning" @click="$emit('action', 'action_confirm_not_zero')">Confirm stock NOT empty</v-btn>
<v-btn x-large color="warning" @click="$emit('action', 'action_confirm_not_zero')">
{{ $t('misc.stock_zero_check.confirm_stock_not_zero') }}
</v-btn>
</v-col>
</v-row>
</div>
Expand Down Expand Up @@ -294,7 +298,7 @@ Vue.component("btn-reset-config", {
this.$root.$router.push(this.$props.redirect);
},
},
template: `<btn-action action="warn" @click="reset_data()">Reload config and menu</btn-action>`,
template: `<btn-action action="warn" @click="reset_data()">{{ $t('btn.reload_config.title') }}</btn-action>`,
});

Vue.component("line-actions-popup", {
Expand Down Expand Up @@ -327,7 +331,7 @@ Vue.component("line-actions-popup", {
<div class="button-list button-vertical-list full">
<v-row class="actions bottom-actions">
<v-col class="text-center" cols="12">
<btn-action v-on="on">Action</btn-action>
<btn-action v-on="on">{{ $t('misc.actions_popup.btn_action') }}</btn-action>
</v-col>
</v-row>
</div>
Expand All @@ -341,7 +345,7 @@ Vue.component("line-actions-popup", {
</v-row>
<v-row align="center">
<v-col class="text-center" cols="12">
<v-btn x-large @click="dialog = false">Back</v-btn>
<v-btn x-large @click="dialog = false">{{ $t('btn.back.title') }}</v-btn>
</v-col>
</v-row>
</div>
Expand All @@ -362,7 +366,9 @@ Vue.component("line-stock-out", {
<div class="button-list button-vertical-list full">
<v-row align="center">
<v-col class="text-center" cols="12">
<btn-action @click="handle_action('confirm_stock_issue')">Confirm stock = 0</btn-action>
<btn-action @click="handle_action('confirm_stock_issue')">
{{ $t('misc.stock_zero_check.confirm_stock_zero') }}
</btn-action>
</v-col>
</v-row>
<v-row align="center">
Expand Down
16 changes: 8 additions & 8 deletions shopfloor_mobile/static/wms/src/components/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ Vue.component("Screen", {
<div class="profile-not-ready" v-if="show_profile_not_ready">
<v-alert type="warning" tile>
<p>Profile not configured yet. Please select one.</p>
<p>{{ $t('app.profile_not_configured') }}</p>
</v-alert>
<div class="button-list button-vertical-list full">
<v-row align="center">
<v-col class="text-center" cols="12">
<v-btn @click="$router.push({'name': 'profile'})">
<v-icon>mdi-account-cog</v-icon>
<span>Configure profile</span>
<span>{{ $t('app.profile_configure') }}</span>
</v-btn>
</v-col>
</v-row>
Expand All @@ -161,7 +161,7 @@ Vue.component("Screen", {
<screen-loading :loading="$root.loading" />
<div class="main-content">
<slot>
<span v-if="this.$root.has_profile">Loading...</span>
<span v-if="this.$root.has_profile">$t('app.loading')</span>
</slot>
</div>
</v-container>
Expand Down Expand Up @@ -195,10 +195,10 @@ Vue.component("nav-items", {
{{ item.name }}
</v-list-item-title>
<v-list-item-subtitle>
<small class="font-weight-light">Scenario: {{ item.scenario }}</small>
<small class="font-weight-light">{{ $t('app.nav.scenario') }} {{ item.scenario }}</small>
<br />
<small class="font-weight-light">
Op Types: <span v-for="pt in item.picking_types" :key="'pt-' + item.id + '-' + pt.id">{{ pt.name }}</span>
{{ $t('app.nav.op_types') }} <span v-for="pt in item.picking_types" :key="'pt-' + item.id + '-' + pt.id">{{ pt.name }}</span>
</small>
</v-list-item-subtitle>
</v-list-item-content>
Expand All @@ -212,19 +212,19 @@ Vue.component("nav-items-extra", {
return [
{
id: "home",
name: "Home",
name: this.$t("screen.home.title"),
icon: "mdi-home",
route: {name: "home"},
},
{
id: "scan-anything",
name: "Scan anything",
name: this.$t("screen.scan_anything.title", {what: ""}),
icon: "mdi-magnify",
route: {name: "scan_anything"},
},
{
id: "settings",
name: "Settings",
name: this.$t("screen.settings.title"),
icon: "mdi-cog-outline",
route: {name: "settings"},
},
Expand Down
6 changes: 3 additions & 3 deletions shopfloor_mobile/static/wms/src/homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export var HomePage = Vue.component("home-page", {
},
props: ["routes"],
template: `
<Screen :screen_info="{title: $t('screen.home.title'), klass: 'home'}" :show-menu="false">
<Screen :screen_info="{title: $t('screen.home.main_title'), klass: 'home'}" :show-menu="false">
<v-list v-if="$root.has_profile">
<nav-items :navigation="navigation"/>
</v-list>
Expand All @@ -37,14 +37,14 @@ export var HomePage = Vue.component("home-page", {
<div class="button-list button-vertical-list full" v-if="$root.demo_mode">
<v-row align="center">
<v-col class="text-center" cols="12">
<btn-action action="cancel" @click="nuke_data_and_reload()">Force reload data and refresh</btn-action>
<btn-action action="cancel" @click="nuke_data_and_reload()">$t('screen.home.action.nuke_data_and_reload')</btn-action>
</v-col>
</v-row>
</div>
<v-footer absolute padless>
<v-col class="text-center font-weight-light" cols="12">
<span class="version">Version:</span> <span class="version-number" v-text="$root.app_info.app_version" />
<span class="version">{{ $t('screen.home.version') }}</span> <span class="version-number" v-text="$root.app_info.app_version" />
</v-col>
</v-footer>
</Screen>
Expand Down
6 changes: 4 additions & 2 deletions shopfloor_mobile/static/wms/src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

import {translation_registry} from "./services/translation_registry.js";

const default_lang = translation_registry.get_default_lang();
const available_langs = translation_registry.available_langs();
const messages = translation_registry.all();

export const i18n = new VueI18n({
locale: "en-US", // set locale
availableLocales: ["en-US", "fr-FR", "de-DE"],
locale: default_lang, // set locale
availableLocales: available_langs,
messages, // set locale messages
});

Expand Down
164 changes: 0 additions & 164 deletions shopfloor_mobile/static/wms/src/i18n.translation.js

This file was deleted.

Loading

0 comments on commit d1d2157

Please sign in to comment.