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

I18n #86

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

I18n #86

Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 34 additions & 0 deletions app/data/translation.de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"OVERVIEW" : "Überblick",

"ACHIEVEMENTS" : "Erfolge",
"ACHIEVEMENTS_GENERAL" : "Allgemein",
"ACHIEVEMENTS_QUESTS" : "Quests",
"ACHIEVEMENTS_EXPLORATION" : "Erkundung",
"ACHIEVEMENTS_PVP" : "Spieler gegen Spieler",
"ACHIEVEMENTS_DUNGEONS_RAIDS" : "Dungeons & Schlachtzuge",
"ACHIEVEMENTS_PROFESSIONS" : "Berufe",
"ACHIEVEMENTS_REPUTATION" : "Ruf",
"ACHIEVEMENTS_SCENARIOS" : "Szenarien",
"ACHIEVEMENTS_WORLD_EVENTS" : "Weltereignisse",
"ACHIEVEMENTS_PET_BATTLES" : "Haustierkämpfe",
"ACHIEVEMENTS_COLLECTIONS" : "Sammlungen",
"ACHIEVEMENTS_GARRISONS" : "Garnisonen",
"ACHIEVEMENTS_LEGACY" : "Klassisch",
"ACHIEVEMENTS_FOS" : "Heldentaten",

"COLLECTABLE" : "Sammlerstück",
"COLLECTABLE_MOUNTS" : "Reittiere",
"COLLECTABLE_COMPANIONS" : "Haustiere",
"COLLECTABLE_BATTLE_PETS" : "Kampfhaustiere",

"CALENDAR" : "Kalender",

"REPUTATION" : "Reputation",

"HELP" : "Hilfe",
"HELP_CONTACT" : "Kontakt",
"HELP_BEER" : "Bier zu mir",

"LANGUAGE" : "Sprache"
}
34 changes: 34 additions & 0 deletions app/data/translation.en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"OVERVIEW" : "Overview",

"ACHIEVEMENTS" : "Achievements",
"ACHIEVEMENTS_GENERAL" : "General",
"ACHIEVEMENTS_QUESTS" : "Quests",
"ACHIEVEMENTS_EXPLORATION" : "Exploration",
"ACHIEVEMENTS_PVP" : "Player vs. Player",
"ACHIEVEMENTS_DUNGEONS_RAIDS" : "Dungeons & Raids",
"ACHIEVEMENTS_PROFESSIONS" : "Professions",
"ACHIEVEMENTS_REPUTATION" : "Reputation",
"ACHIEVEMENTS_SCENARIOS" : "Scenarios",
"ACHIEVEMENTS_WORLD_EVENTS" : "World Events",
"ACHIEVEMENTS_PET_BATTLES" : "Pet Battles",
"ACHIEVEMENTS_COLLECTIONS" : "Collections",
"ACHIEVEMENTS_GARRISONS" : "Garrisons",
"ACHIEVEMENTS_LEGACY" : "Legacy",
"ACHIEVEMENTS_FOS" : "Feats of Strength",

"COLLECTABLE" : "Collectable",
"COLLECTABLE_MOUNTS" : "Mounts",
"COLLECTABLE_COMPANIONS" : "Companions",
"COLLECTABLE_BATTLE_PETS" : "Battle Pets",

"CALENDAR" : "Calendar",

"REPUTATION" : "Reputation",

"HELP" : "Help",
"HELP_CONTACT" : "Contact",
"HELP_BEER" : "Beer Me",

"LANGUAGE" : "Language"
}
34 changes: 34 additions & 0 deletions app/data/translation.es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"OVERVIEW" : "Visión general",

"ACHIEVEMENTS" : "Logros",
"ACHIEVEMENTS_GENERAL" : "General",
"ACHIEVEMENTS_QUESTS" : "Misiones",
"ACHIEVEMENTS_EXPLORATION" : "Exploración",
"ACHIEVEMENTS_PVP" : "Jugador contra Jugador",
"ACHIEVEMENTS_DUNGEONS_RAIDS" : "Mazmorras y bandas",
"ACHIEVEMENTS_PROFESSIONS" : "Profesiones",
"ACHIEVEMENTS_REPUTATION" : "Reputación",
"ACHIEVEMENTS_SCENARIOS" : "Gestas",
"ACHIEVEMENTS_WORLD_EVENTS" : "Eventos del mundo",
"ACHIEVEMENTS_PET_BATTLES" : "Duelos de mascotas",
"ACHIEVEMENTS_COLLECTIONS" : "Colecciones",
"ACHIEVEMENTS_GARRISONS" : "Ciudadelas",
"ACHIEVEMENTS_LEGACY" : "Logros antiguos",
"ACHIEVEMENTS_FOS" : "Proezas de fuerza",

"COLLECTABLE" : "Coleccionable",
"COLLECTABLE_MOUNTS" : "Monturas",
"COLLECTABLE_COMPANIONS" : "Compañeros",
"COLLECTABLE_BATTLE_PETS" : "Mascotas de duelo",

"CALENDAR" : "Calendario",

"REPUTATION" : "Reputación",

"HELP" : "Ayuda",
"HELP_CONTACT" : "Contacto",
"HELP_BEER" : "Me cerveza",

"LANGUAGE" : "Lengua"
}
35 changes: 35 additions & 0 deletions app/data/translation.fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"OVERVIEW" : "Vue d'ensemble",

"ACHIEVEMENTS" : "Hauts faits",
"ACHIEVEMENTS_GENERAL" : "Général",
"ACHIEVEMENTS_QUESTS" : "Quêtes",
"ACHIEVEMENTS_EXPLORATION" : "Exploration",
"ACHIEVEMENTS_PVP" : "Joueur contre Joueur",
"ACHIEVEMENTS_DUNGEONS_RAIDS" : "Donjons & raids",
"ACHIEVEMENTS_PROFESSIONS" : "Métiers",
"ACHIEVEMENTS_REPUTATION" : "Réputation",
"ACHIEVEMENTS_SCENARIOS" : "Scénarios",
"ACHIEVEMENTS_WORLD_EVENTS" : "Évènements mondiaux",
"ACHIEVEMENTS_PET_BATTLES" : "Combats de mascottes",
"ACHIEVEMENTS_COLLECTIONS" : "Collections",
"ACHIEVEMENTS_GARRISONS" : "Fiefs",
"ACHIEVEMENTS_LEGACY" : "Héritage",
"ACHIEVEMENTS_FOS" : "Tours de force",

"COLLECTABLE" : "Collectable",
"COLLECTABLE_MOUNTS" : "Montures",
"COLLECTABLE_COMPANIONS" : "Compagnons",
"COLLECTABLE_BATTLE_PETS" : "Mascottes de combat",

"CALENDAR" : "Calendrier",

"REPUTATION" : "Réputation",

"HELP" : "Aide",
"HELP_CONTACT" : "Contact",
"HELP_BEER" : "Bière moi",

"LANGUAGE" : "Langue"
}

34 changes: 34 additions & 0 deletions app/data/translation.ru.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"OVERVIEW" : "Обзор",

"ACHIEVEMENTS" : "Достижения",
"ACHIEVEMENTS_GENERAL" : "Общее",
"ACHIEVEMENTS_QUESTS" : "Задания",
"ACHIEVEMENTS_EXPLORATION" : "Исследование",
"ACHIEVEMENTS_PVP" : "PvP",
"ACHIEVEMENTS_DUNGEONS_RAIDS" : "Подземелья и рейды",
"ACHIEVEMENTS_PROFESSIONS" : "Профессии",
"ACHIEVEMENTS_REPUTATION" : "Репутация",
"ACHIEVEMENTS_SCENARIOS" : "Сценарии",
"ACHIEVEMENTS_WORLD_EVENTS" : "Игровые события",
"ACHIEVEMENTS_PET_BATTLES" : "Битвы питомцев",
"ACHIEVEMENTS_COLLECTIONS" : "Коллекции",
"ACHIEVEMENTS_GARRISONS" : "Гарнизоны",
"ACHIEVEMENTS_LEGACY" : "Наследие",
"ACHIEVEMENTS_FOS" : "Великие подвиги",

"COLLECTABLE" : "Коллекции",
"COLLECTABLE_MOUNTS" : "Транспорт",
"COLLECTABLE_COMPANIONS" : "Спутники",
"COLLECTABLE_BATTLE_PETS" : "Боевые питомцы",

"CALENDAR" : "Календарь",

"REPUTATION" : "Репутация",

"HELP" : "Помощь",
"HELP_CONTACT" : "Контакты",
"HELP_BEER" : "Купить мне пива",

"LANGUAGE" : "Язык"
}
2 changes: 2 additions & 0 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<script src="bower_components/angular-bootstrap/ui-bootstrap-tpls.js"></script>
<script src="bower_components/angular-ui-select/dist/select.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/angular-cookies/index.js"></script>
<!-- endbower -->
<!-- endbuild -->

Expand Down Expand Up @@ -84,6 +85,7 @@
<script src="scripts/services/planner.service.js"></script>
<script src="scripts/services/factions.service.js"></script>
<script src="scripts/services/settings.service.js"></script>
<script src="scripts/services/i18n.service.js"></script>

<script src="scripts/filters/filters.js"></script>
<script src="scripts/directives/directives.js"></script>
Expand Down
1 change: 1 addition & 0 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.module('simpleArmoryApp', [
'ngRoute',
'ngSanitize',
'ngCookies',
'ui.bootstrap',
'ui.select'])
.config(config);
Expand Down
13 changes: 10 additions & 3 deletions app/scripts/controllers/application.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.module('simpleArmoryApp')
.controller('ApplicationCtrl' , ApplicationCtrl);

function ApplicationCtrl($scope, LoginService, $location, $filter, KeyboardService, KonamiService) {
function ApplicationCtrl($scope, LoginService, $location, $filter, KeyboardService, KonamiService, i18nService) {

// default to not logged in
$scope.isLoggedIn = false;
Expand Down Expand Up @@ -42,7 +42,6 @@

// Helper function for percentage numbers. Used in a lot of screens
$scope.percent = function(n, d) {

return $filter('number')(((n / d) * 100), 0);
};

Expand Down Expand Up @@ -71,6 +70,14 @@
return 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';
}
};

// i18n
$scope.translate = function(lng) {
i18nService.setLanguage($scope, lng);
};

$scope.supportedLanguages = i18nService.getSupportedLanguages();
$scope.translate(i18nService.getLanguage());
}

})();
})();
2 changes: 1 addition & 1 deletion app/scripts/controllers/calendar.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@

rows += '<div>';
angular.forEach(achievs, function(ach) {
rows += '<a href="//' + $scope.settings.WowHeadUrl + '/achievement=' + ach.id + '" ' +
rows += '<a href="//' + $scope.i18n.selectedLanguage + '.' + $scope.settings.WowHeadUrl + '/achievement=' + ach.id + '" ' +
'rel="who=' + prettyName + '&amp;when=' + ach.completed +'">' +
'<img src="//wow.zamimg.com/images/wow/icons/medium/' +
ach.icon.toLowerCase() + '.jpg" width="36" height="36" border="0"></a>';
Expand Down
42 changes: 22 additions & 20 deletions app/scripts/directives/reputationRow.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
'use strict';

(function() {

angular
.module('simpleArmoryApp')
.directive('saReputationRow', ReputationRow);

function ReputationRow() {
return {
controller: ReputationRowController,
restrict: 'E',
scope: {
faction: '=',
},
templateUrl: function () {
return 'views/reputationRow.html';
return {
controller: ReputationRowController,
restrict: 'E',
scope: {
faction: '=',
},
templateUrl: function () {
return 'views/reputationRow.html';
}
};
};
}

// Pixel widths of the different level types
var levelWidths = {
'hated': 150,
'hostel': 25,
var levelWidths = {
'hated': 150,
'hostel': 25,
'unfriendly': 25,
'neutral': 25,
'friendly': 40,
Expand All @@ -35,20 +35,22 @@
'friend': 50,
'goodFriends': 50,
'bestFriends': 50
};
};

/*@ngInject*/
var ReputationRowController = function ($scope, SettingsService) {
/*@ngInject*/
var ReputationRowController = function ($scope, SettingsService, i18nService) {

// Extend the row's isolated scope
$scope.settings = SettingsService;

i18nService.updateScope($scope);

$scope.getWidth = function(level) {

var num = $scope.faction[level] ? $scope.faction[level] : 0;

// pulls out the faction level percentage from the scope
// applies that percentage to the possible fixed width for the div
return (num / 100) * levelWidths[level] + 'px';
// pulls out the faction level percentage from the scope
// applies that percentage to the possible fixed width for the div
return (num / 100) * levelWidths[level] + 'px';
};
};
})();
Loading