Skip to content

Commit

Permalink
Merge pull request #397 from ph1p/master
Browse files Browse the repository at this point in the history
Add localisation support
  • Loading branch information
sallar authored Nov 14, 2017
2 parents de59eef + e04411e commit bb9ee4f
Show file tree
Hide file tree
Showing 42 changed files with 2,721 additions and 938 deletions.
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({
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
95 changes: 95 additions & 0 deletions locales/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"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":"Verkleinerte Seitenleiste",
"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-group-custom": "Nach {title} 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",
"archive-not-found-error": "Archiv wurde nicht gefunden",
"authentication-failed-error": "Authentifizierung fehlgeschlagen.",
"unknown-error": "Ein unbekannter Fehler ist aufgetreten",
"passwords-font-match-error": "Die Passwörter stimmen nicht überein.",
"confirm-password": "Passwort bestätigen",
"group-not-found-error": "Gruppe wurde nicht gefunden.",
"sort-definition-not-found-error": "Sortieroption nicht gefunden",
"insufficient-data-provided-error": "Nicht genügend Daten zum Sortieren",
"check-for-update-error": "Fehler beim Überprüfen von Updates"
}
95 changes: 95 additions & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"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-group-custom": "Move to {title}",
"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",
"archive-not-found-error": "Archive source was not found.",
"authentication-failed-error": "Authentication failed.",
"unknown-error": "An unknown error has occurred",
"passwords-font-match-error": "Your passwords don't match.",
"confirm-password": "Confirm Password",
"group-not-found-error": "Group has not been found.",
"sort-definition-not-found-error": "Sort definition not found",
"insufficient-data-provided-error": "Insufficient data provided for sorting",
"check-for-update-error": "Check for Update Error"
}
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

0 comments on commit bb9ee4f

Please sign in to comment.