Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
Merge pull request #763 from blockchain/translations
Browse files Browse the repository at this point in the history
Translations
  • Loading branch information
plondon authored Nov 9, 2016
2 parents fabae6a + dd86a50 commit 98512cc
Show file tree
Hide file tree
Showing 26 changed files with 12,104 additions and 4,412 deletions.
2 changes: 2 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ module.exports = (grunt) ->
},
"merge-json": # TODO: generate this list...
bg: {src: [ "locales/bg-*.json" ], dest: "build/locales/bg.json"}
cs: {src: [ "locales/cs-*.json" ], dest: "build/locales/cs.json"}
da: {src: [ "locales/da-*.json" ], dest: "build/locales/da.json"}
de: {src: [ "locales/de-*.json" ], dest: "build/locales/de.json"}
el: {src: [ "locales/el-*.json" ], dest: "build/locales/el.json"}
Expand All @@ -225,6 +226,7 @@ module.exports = (grunt) ->
sv: {src: [ "locales/sv-*.json" ], dest: "build/locales/sv.json"}
th: {src: [ "locales/th-*.json" ], dest: "build/locales/th.json"}
tr: {src: [ "locales/tr-*.json" ], dest: "build/locales/tr.json"}
uk: {src: [ "locales/uk-*.json" ], dest: "build/locales/uk.json"}
vi: {src: [ "locales/vi-*.json" ], dest: "build/locales/vi.json"}
"zh-cn": {src: [ "locales/zh-cn-*.json" ], dest: "build/locales/zh-cn.json"}

Expand Down
2 changes: 1 addition & 1 deletion app/landing.jade
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
h2.em-200.mvn.font-4.font-3-mobile.center(translate=".NEW_TO_BITCOIN")
.new.container-max-width.container-fluid.width-100
.flex-row.flex-column-mobile.flex-column-med
video-container.col-md-6.blue-play-button.small-image(img="img/blockchain-ad-placeholder.jpg" src="https://storage.googleapis.com/bc_public_assets/video/blockchain-ad.mp4")
video-container.col-md-6.blue-play-button.small-image(img="img/blockchain-ad-placeholder.jpg" ng-src="adUrl")
.flex-column.width-50.flex-1.flex-center.flex-justify
#timeline.flex-row.flex-1.flex-center.mhvl.mhl-mobile.mbl
img.flex-1(src='img/logo-timeline.png' alt="Blockchain Bitcoin Timeline")
Expand Down
13 changes: 12 additions & 1 deletion assets/js/landingCtrl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
angular.module('walletApp').controller('LandingCtrl', LandingCtrl);

function LandingCtrl ($scope, $state) {
function LandingCtrl ($scope, $state, $sce, languages) {
$scope.firstLoad = () => {
let language_code = languages.get();

if (language_code === 'zh-cn' || language_code === 'zh_CN') {
$scope.adUrl = $sce.trustAsResourceUrl('https://storage.googleapis.com/bc_public_assets/video/blockchain-ad-zh-cn.mp4');
} else {
$scope.adUrl = $sce.trustAsResourceUrl('https://storage.googleapis.com/bc_public_assets/video/blockchain-ad.mp4');
}
};

$scope.firstLoad();
$scope.signup = () => {
$state.go('public.signup', { email: $scope.fields.email });
};
Expand Down
4 changes: 3 additions & 1 deletion assets/js/services/bcTranslationLoader.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BCTranslateStaticFilesLoader.$inject = ['$http', '$q', '$translateStaticFilesLoa
function BCTranslateStaticFilesLoader ($http, $q, $translateStaticFilesLoader, $rootScope) {
const map = {
de: 'build/locales/de.json',
cs: 'build/locales/cs.json',
hi: 'build/locales/hi.json',
no: 'build/locales/no.json',
ru: 'build/locales/ru.json',
Expand All @@ -34,7 +35,8 @@ function BCTranslateStaticFilesLoader ($http, $q, $translateStaticFilesLoader, $
da: 'build/locales/da.json',
ro: 'build/locales/ro.json',
nl: 'build/locales/nl.json',
tr: 'build/locales/tr.json'
tr: 'build/locales/tr.json',
uk: 'build/locales/uk.json'
};

return function (options) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/sharedDirectives/public-header.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function publicHeader ($rootScope, $location, languages) {
<li class="item"><a href="{{rootURL}}api" translate="API" class="pam"></a></li>
<li class="item active"><a href="#" translate="WALLET" class="pam"></a></li>
</ul>
<ul ng-if="false" class="nav navbar-nav navbar-right hidden-sm">
<ul class="nav navbar-nav navbar-right hidden-sm">
<li class="hidden-md">
<form action="{{searchUrl}}" method="GET">
<input type="text" name="search" class="form-control input-sm search-query" placeholder="{{'SEARCH'|translate}}">
Expand Down
15 changes: 7 additions & 8 deletions assets/js/sharedDirectives/video-container.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ angular

videoContainer.$inject = ['$window', '$timeout', '$sce'];

function videoContainer ($window, $timeout, $sce) {
function videoContainer ($window, $timeout) {
const directive = {
restrict: 'E',
template: `
<div ng-click="load(); toggle();" ng-class="{'playing': playing}" class="video-container center"><img class="imag-prev" ng-src="{{::img}}" ng-class="{'transparent': playing}"/><img src="img/spinner.gif" class="loading"/>
<video src="" type="video/mp4"></video>
<video ng-src="{{ ngSrc }}" type="video/mp4"></video>
</div>
`,
replace: true,
scope: {},
scope: {
ngSrc: '=',
img: '@',
class: '@'
},
link: link
};

return directive;

function link (scope, elem, attrs) {
scope.img = attrs['img'];
scope.src = attrs['src'];
scope.class = attrs['class'];
scope.videoElem = elem.find('video')[0];

scope.toggle = () => scope.playing = !scope.playing;
scope.trust = (src) => $sce.trustAsResourceUrl(src);
scope.load = () => scope.videoElem.setAttribute('src', scope.trust(scope.src));

scope.$watch('playing', (isPlaying) => {
if (!scope.videoElem.play && !scope.videoElem.pause) return;
Expand Down
2 changes: 1 addition & 1 deletion assets/js/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function TranslationsConfig ($translateProvider) {
$translateProvider.registerAvailableLanguageKeys([
'de', 'hi', 'no', 'ru', 'pt', 'bg', 'fr', 'zh-cn',
'hu', 'sl', 'id', 'sv', 'ko', 'el', 'en', 'it',
'es', 'vi', 'th', 'ja', 'pl', 'da', 'ro', 'nl', 'tr'
'es', 'vi', 'th', 'ja', 'pl', 'da', 'ro', 'nl', 'tr', 'cs', 'uk'
]);

$translateProvider.useLoader('BCTranslateStaticFilesLoader');
Expand Down
Loading

0 comments on commit 98512cc

Please sign in to comment.