Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localisation support #397

Merged
merged 32 commits into from
Nov 14, 2017
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
31209d0
Add language support
ph1p Nov 12, 2017
a24242e
Add language support to main process
ph1p Nov 12, 2017
e022f34
Add breaks to language config
ph1p Nov 12, 2017
d280a9b
Spanish translation with the help of google translator 🤙
ph1p Nov 12, 2017
ab5003c
Move language files
ph1p Nov 12, 2017
c87a691
Remove unused resolve from webpack config
ph1p Nov 12, 2017
1ec27bf
Add all items to setupMenu method to access translations
ph1p Nov 12, 2017
4f9ab34
Update packages
ph1p Nov 13, 2017
1dec0ef
Replace MinifyPlugin with UglifyJSPlugin, because of CALL_AND_RETRY_LAST
ph1p Nov 13, 2017
56d4149
Fix test bug (https://github.com/electron/spectron/issues/244)
ph1p Nov 13, 2017
7e643a3
Add i18n setup to file-manager.js
ph1p Nov 13, 2017
a687446
Fix archive button style (add space)
ph1p Nov 13, 2017
a151e77
Add enabled state to menu
ph1p Nov 13, 2017
9d8b2b2
Add webpack-alias plugin for better path resolving (webpack.config.ba…
ph1p Nov 13, 2017
eb5eab8
Update package-lock.json
ph1p Nov 13, 2017
ae899aa
Remove PWD from .babelrc
ph1p Nov 13, 2017
9cf203d
Add full translation (german, english)
ph1p Nov 14, 2017
41d5986
Add missing translations
ph1p Nov 14, 2017
07124f1
Add cache verification for npm on appveyor
perry-mitchell Nov 14, 2017
c8c1173
Update build file
ph1p Nov 14, 2017
bd6b1da
Merge branch 'master' of github.com:ph1p/buttercup-desktop
ph1p Nov 14, 2017
cece292
Add missing intl const
ph1p Nov 14, 2017
099d118
Set spectron to fixed version
ph1p Nov 14, 2017
0e7f3b6
Add missing translations to main menu
ph1p Nov 14, 2017
06b6758
Fix language & config lookup
sallar Nov 14, 2017
41b5cef
Merge branch 'master' of github.com:ph1p/buttercup-desktop
sallar Nov 14, 2017
6b28025
Revert upgraded deps
sallar Nov 14, 2017
6be7cd1
Upgrade webpack and babel
sallar Nov 14, 2017
1511207
Update more deps
sallar Nov 14, 2017
b64d210
Revert package-lock file
sallar Nov 14, 2017
0db4b88
Remove unnecessary scope in i18n setup
ph1p Nov 14, 2017
e04411e
Fix i18n import path
ph1p Nov 14, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"transform-object-rest-spread",
"transform-strict-mode",
"transform-class-properties",
"jsx-control-statements"
"jsx-control-statements",
["webpack-alias", { "config": "./config/webpack.config.base.js" } ]
],
"env": {
"production": {
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ cache:

install:
- ps: Install-Product node $env:nodejs_version
- npm cache verify
- npm install
- npm run build

Expand Down
11 changes: 7 additions & 4 deletions config/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ module.exports = {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
use: 'babel-loader',
include: [
join(__dirname, '../src'),
join(__dirname, '../node_modules/buttercup-generator')
]
},
{
test: /\.(svg|png|ttf|woff|woff2)$/,
loader: 'file-loader',
use: 'file-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
use: ['style-loader', 'css-loader']
}
]
},
Expand All @@ -28,7 +28,10 @@ module.exports = {
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['.js', '.jsx', '.json', '.scss']
extensions: ['.js', '.jsx', '.json', '.scss'],
alias: {
locales: join(__dirname, '../locales')
}
},
plugins: [],
externals: ['buttercup-importer', 'zxcvbn', 'dropbox', 'webdav', 'conf']
Expand Down
61 changes: 52 additions & 9 deletions config/webpack.config.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { resolve } = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const BabiliPlugin = require('babili-webpack-plugin');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const baseConfig = require('./webpack.config.base');

module.exports = merge(baseConfig, {
Expand All @@ -21,18 +21,40 @@ module.exports = merge(baseConfig, {
rules: [
{
test: /\.global\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader: 'css-loader!sass-loader'
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
minimize: true
}
},
{
loader: 'sass-loader'
}
]
})
},

{
test: /^((?!\.global).)*\.scss$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style-loader',
loader:
'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass-loader'
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
modules: true,
importLoaders: true,
localIdentName: '[name]__[local]___[hash:base64:5]',
minimize: true
}
},
{
loader: 'sass-loader'
}
]
})
}
]
Expand All @@ -47,7 +69,28 @@ module.exports = merge(baseConfig, {
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new BabiliPlugin(),
new UglifyJSPlugin({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does uglifyJS support ES6 which we are using? I think the reason I used Babili was that it was the only one that supported ES6 out of the box.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jep. Documentation says, that i can use the ecma option (https://github.com/webpack-contrib/uglifyjs-webpack-plugin#uglifyoptions)

parallel: true,
exclude: /\/node_modules/,
uglifyOptions: {
ecma: 8,
mangle: true,
compress: {
sequences: true,
dead_code: true,
conditionals: true,
booleans: true,
unused: true,
if_return: true,
join_vars: true,
drop_console: true
},
output: {
comments: false,
beautify: false
}
}
}),
new ExtractTextPlugin({
filename: '[name].css',
allChunks: true
Expand Down
85 changes: 85 additions & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"unlock-archive": "Entsperre ein Archiv um zu starten ({os}).",
"welcome-back-title": "Willkommen zurück bei Buttercup.",
"welcome-title": "Willkommen bei Buttercup.",
"welcome-caption": "Du hast bis jetzt noch keine Archive. Warum fügst du nicht eins hinzu?",
"open-archive-file": "Archiv öffnen",
"new-archive-file": "Archiv erstellen",
"connect-cloud-sources": "Einen Cloud Services verbinden",
"add-archive": "Archiv hinzufügen",
"open-archive": "Archiv öffnen",
"cancel": "Abbrechen",
"go-back": "Zurück",
"new-archive": "Neues Archiv",
"open-in-buttercup": "Mit Buttercup öffnen",
"master-password": "Master Passwort",
"confirm": "Bestätigen",
"nevermind": "Abbrechen",
"password": "Passwort",
"language": "Sprache",
"copy-to-clipboard": "In die Zwischenablage kopieren",
"edit": "Bearbeiten",
"view": "Darstellung",
"window": "Fenster",
"help": "Hilfe",
"visit-our-website":"Besuche unsere Website",
"privacy-policy":"Datenschutzrichtlinie",
"view-changelog-for-v":"Changelog für v{version} aufrufen",
"speech":"Sprachhilfe",
"condensed-sidebar":"Kleine Sidebar",
"auto-hide-menubar":"Menüleiste automatisch ausblenden",
"new-group":"Neue Gruppe",
"title-asc":"Titel: Aufsteigend",
"title-desc":"Titel: Absteigend",
"time-asc":"Zeit: Aufsteigend",
"time-desc":"Zeit: Absteigend",
"add-group":"Gruppe hinzufügen",
"rename":"Umbenennen",
"move-to-root":"Ins Hauptverzeichnis verschieben",
"move-to-group":"In Gruppe verschieben",
"move-to-trash":"In den Papierkorb verschieben",
"delete":"Löschen",
"delete-permanently":"Permanent löschen",
"add-entry":"Eintrag hinzufügen",
"search":"Suche",
"select-or-create-an-entry":"Wähle oder erstelle einen Eintrag",
"save":"Speichern",
"empty-trash": "Papierkorb leeren",
"empty-trash-question": "Willst du den Papierkorb wirklich leeren?",
"no-custom-fields-info-text":"Noch keine benutzerdefinierten Felder hinzugefügt. Warum fügst du nicht ein paar hinzu?",
"custom-fields":"Benutzerdefinierten Felder",
"title":"Titel",
"username":"Benutzername",
"secure-password":"Sicheres Passwort",
"untitled":"Ohne Titel",
"add-new-field":"Neues Feld hinzufügen",
"copy":"Kopieren",
"hide":"Verbergen",
"reveal":"Aufdecken",
"reveal-password":"Passwort anzeigen",
"installing":"Installiere",
"update-available-message":"Buttercup {version} ist verfügbar. Klicke hier zum Installieren.",
"archive-saved-loading-info":"Dein Archiv wird gespeichert.<br>Schließt automatisch",
"unlock":"Entsperren",
"open":"Öffnen",
"change-color":"Farbe wechseln",
"import":"Importieren",
"import-from-type":"Von {name} Archiv (.{extension})",
"import-to-type":"Zu {name}",
"archive-remove-with-name":"Entferne {name}",
"dropbox-connection-failed-info":"Die Verbindung zum Dropbox-Server ist fehlgeschlagen. Bitte versuche es später noch einmal.",
"connect-to-dropbox":"Mit Dropbox verbinden",
"authenticate-with-dropbox":"Authentifizieren mit Dropbox",
"dropbox-description-text":"Verbinde Buttercup mit deinem Dropbox-Konto, um deine Archive zu lesen und zu speichern.<br /> Wir speichern keine deiner Dropbox-Daten.",
"webdav-connection-failed-info":"Die Verbindung zu {endpoint} ist fehlgeschlagen. Bitte überprüfe deine Anmeldeinformationen und versuche es erneut.",
"connect-to-wedav": "Verbindung zu {title} Server herstellen",
"webdav-description-text":"Gib Benutzername, Passwort und deine {title} Server-Adresse an, um eine Verbindung herzustellen und ein Buttercup-Archiv auszuwählen. Wir <strong>speichern</strong> die Anmeldeinformationen und verschlüsseln sie.",
"name":"Name",
"size":"Größe",
"date":"Datum",
"open-url-in-browser": "URL im Browser öffnen",
"new-field": "Neues Feld",
"label": "Bezeichnung",
"archive": "Archiv",
"file": "Datei"
}
85 changes: 85 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"welcome-back-title": "Welcome back to Buttercup.",
"unlock-archive": "Unlock an archive to begin ({os}).",
"welcome-title": "Welcome to Buttercup.",
"welcome-caption": "You haven't added any archives yet. Why not add one?",
"open-archive-file": "Open Archive File",
"new-archive-file": "New Archive File",
"connect-cloud-sources": "Connect Cloud Sources",
"add-archive": "Add Archive",
"cancel": "Cancel",
"go-back": "Go Back",
"new-archive": "New Archive",
"open-archive": "Open Archive",
"open-in-buttercup": "Open in Buttercup",
"master-password": "Master Password",
"confirm": "Confirm",
"nevermind": "Nevermind",
"password": "Password",
"language": "Language",
"copy-to-clipboard": "Copy To Clipboard",
"edit": "Edit",
"view": "View",
"window": "Window",
"help": "Help",
"visit-our-website":"Visit Our Website",
"privacy-policy":"Privacy Policy",
"view-changelog-for-v":"View Changelog For v{version}",
"speech":"Speech",
"condensed-sidebar":"Condensed Sidebar",
"auto-hide-menubar":"Auto Hide Menubar",
"new-group":"New Group",
"title-asc":"Title: Ascending",
"title-desc":"Title: Descending",
"time-asc":"Time: Ascending",
"time-desc":"Time: Descending",
"add-group":"Add Group",
"rename":"Rename",
"move-to-root":"Move to Root",
"move-to-group":"Move to Group",
"move-to-trash":"Move to Trash",
"delete":"Delete",
"delete-permanently":"Delete Permanently",
"add-entry":"Add Entry",
"search":"Search",
"select-or-create-an-entry":"Select or Create an Entry",
"save":"Save",
"empty-trash": "Empty Trash",
"empty-trash-question": "Are you sure you want to empty Trash?",
"no-custom-fields-info-text":"No custom fields yet. Why not add one?",
"custom-fields":"Custom Fields",
"title":"Title",
"username":"Username",
"secure-password":"Secure password",
"untitled":"Untitled",
"add-new-field":"Add New Field",
"copy":"Copy",
"hide":"Hide",
"reveal":"Reveal",
"reveal-password":"Reveal Password",
"installing":"Installing",
"update-available-message":"Buttercup {version} is available. Click here to install now.",
"archive-saved-loading-info":"Your archive is being saved.<br>Exiting automatically",
"unlock":"Unlock",
"open":"Open",
"change-color":"Change Color",
"import":"Import",
"import-from-type":"From {name} archive (.{extension})",
"import-to-type":"To {name}",
"archive-remove-with-name":"Remove {name}",
"dropbox-connection-failed-info":"Connection to Dropbox server failed. Please try again later",
"connect-to-dropbox":"Connect to Dropbox",
"authenticate-with-dropbox":"Authenticate with Dropbox",
"dropbox-description-text":"Connect Buttercup to your Dropbox account to read and save your archives.<br />We won't save your Dropbox username or password.",
"webdav-connection-failed-info":"Connection to {endpoint} failed. Please check your credentials and try again.",
"connect-to-wedav": "Connect to {title} Server",
"webdav-description-text":"Enter your {title} Endpoint Address, Username and Password to connect and choose a Buttercup Archive. We <strong>will save</strong> your credentials and encrypt it.",
"name":"Name",
"size":"Size",
"date":"Date",
"open-url-in-browser": "Open URL in Browser",
"new-field": "New Field",
"label": "Label",
"archive": "Archive",
"file": "File"
}
20 changes: 20 additions & 0 deletions locales/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"welcome-back-title": "Bienvenido de nuevo a Buttercup.",
"unlock-archive": "Desbloquee un archivo para comenzar ({os}).",
"welcome-title": "Bienvenido a Buttercup.",
"welcome-caption":"Aún no ha agregado ningún archivo. ¿Por qué no agregar uno?",
"open-archive-file": "Abrir archivo de archivo",
"new-archive-file": "Nuevo archivo archivado",
"connect-cloud-sources": "Connect Cloud Sources",
"add-archive": "Agregar archivo",
"cancel": "Cancelar",
"go-back": "Volver atrás",
"new-archive": "Nuevo archivo",
"open-in-buttercup": "Abrir en Buttercup",
"master_password": "Contraseña maestra",
"confirm": "Confirmar",
"nevermind": "No importa",
"password": "Contraseña",
"language": "Idioma",
"copy-to-clipboard": "Copiar al portapapeles"
}
Loading