Skip to content

Commit

Permalink
Merge pull request #387 from kmkzif/master
Browse files Browse the repository at this point in the history
Add portuguese language support
  • Loading branch information
HarveyKandola authored Jul 13, 2022
2 parents b510615 + cfd7ebd commit d9827df
Show file tree
Hide file tree
Showing 9 changed files with 773 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/tin
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/pdfjs /go/src/github.com/documize/community/edition/static/public/pdfjs
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n /go/src/github.com/documize/community/edition/static/public/i18n
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/*.* /go/src/github.com/documize/community/edition/static/
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n/*.json /go/src/github.com/documize/community/edition/static/i18n
COPY --from=frontbuilder /go/src/github.com/documize/community/gui/dist-prod/i18n/*.json /go/src/github.com/documize/community/edition/static/i18n/
COPY domain/mail/*.html /go/src/github.com/documize/community/edition/static/mail/
COPY core/database/templates/*.html /go/src/github.com/documize/community/edition/static/
COPY core/database/scripts/mysql/*.sql /go/src/github.com/documize/community/edition/static/scripts/mysql/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Languages supported out-of-the-box:
- English
- German
- Chinese (中文)
- Portuguese - Brazil (Português - Brasil)

PR's welcome for additional languages.

Expand Down
1 change: 1 addition & 0 deletions core/i18n/localize.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func SupportedLocales() (locales []string) {
locales = append(locales, "en-US")
locales = append(locales, "de-DE")
locales = append(locales, "zh-CN")
locales = append(locales, "pt-BR")

return
}
Expand Down
2 changes: 1 addition & 1 deletion gui/app/pods/folders/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<div class="form-group">
<label for="new-space-name">{{localize 'name'}}</label>
{{input type="text" id="new-space-name" class="form-control mousetrap" placeholder=(localize 'space_name') value=spaceName}}
<small class="form-text text-muted">Characters and numbers only</small>
<small class="form-text text-muted">{{localize 'space_name_rules'}}</small>
</div>

<div class="form-group">
Expand Down
8 changes: 7 additions & 1 deletion gui/app/services/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Service, { inject as service } from '@ember/service';
import $ from 'jquery';

export default Service.extend({
langs: { enUS: [], deDE: [] , zhCN: [] },
langs: { enUS: [], deDE: [] , zhCN: [], ptBR: [] },
locales: [],
session: service(),

Expand All @@ -24,6 +24,9 @@ export default Service.extend({
$.getJSON("/i18n/zh-CN.json", (data) => {
this.langs.zhCN = data;
});
$.getJSON("/i18n/pt-BR.json", (data) => {
this.langs.ptBR = data;
});
},

localize(key, ...args) {
Expand All @@ -39,6 +42,9 @@ export default Service.extend({
case "zh-CN":
str = this.langs.zhCN[key];
break;
case "pt-BR":
str = this.langs.ptBR[key];
break;
}

if (_.isUndefined(str)) {
Expand Down
2 changes: 2 additions & 0 deletions gui/public/i18n/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"versioned": "Versioned",
"versions_explained": "Erstellen Sie mehrere Versionen desselben Inhalts – Benutzer können auswählen, welche Version angezeigt werden soll",
"change_control": "Änderungskontrolle",
"change_control_explain": "Select change control method",
"pin": "Pin",
"pinned": "Pinned",
"unpin": "Unpin",
Expand Down Expand Up @@ -212,6 +213,7 @@
"space_change_prompt": "Space wählen",
"space_new": "Neuer Space",
"space_name": "Space Name",
"space_name_rules": "Characters and numbers only",
"space_description": "Space Beschreibung",
"space_clone": "Space kopieren",
"space_select": "Space auswählen",
Expand Down
1 change: 1 addition & 0 deletions gui/public/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
"space_change_prompt": "Select space",
"space_new": "New Space",
"space_name": "Space name",
"space_name_rules": "Characters and numbers only",
"space_description": "Space description",
"space_clone": "Clone Space",
"space_select": "Select Space",
Expand Down
Loading

0 comments on commit d9827df

Please sign in to comment.