Bahattin Çiniç
Software Developer
#: contrib/admin/templates/registration/password_reset_form.html:19
msgid "Reset my password"
msgstr "Şifremi sıfırla"
#: contrib/admin/templates/registration/password_reset_form.html:19
msgid "Email address:"
msgstr "E-posta adresi:"
<form action="" method="post">
{% csrf_token %}
{{ form.email.errors }}
<p>
<label for="id_email">
{% trans 'Email address:' %}</label>
{{ form.email }}
<input type="submit" value="{% trans 'Reset my password' %}" />
</p>
</form>
Markup (Django Template Engine)
PO Dosyası
AngularJs in destek verdigi diller
code.angularjs.org/1.3.2/i18n/
bower install angular-i18n
Para Birimi, Tarih Çevirimleri
<script>
var app = angular.module('myApp', []);
app.controller('localizationController', ['$scope', function($scope){
$scope.date = new Date();
$scope.money = 100;
$scope.age = 1234.56789
}]);
</script>
<div ng-app='myApp'>
<div ng-controller='localizationController'>
<!-- Response: Saturday, November 8, 2014 -->
{{ date |date:"fullDate" }}
</br>
<!-- Response: $100.00 -->
{{ money |currency }}
<!-- Response: 1,234.568 -->
{{ age |number }}
</div>
</div>
var app = angular.module('myApp', ['pascalprecht.translate']);
app.config(['$translateProvider', function ($translateProvider) {
$translateProvider.translations('en', {
"APP_TITLE": "VNGRS AngularJS Bootcamp",
"INTRODUCTION_TEXT": "First angularjs Conference in Istanbul"
});
$translateProvider.translations('tr', {
"APP_TITLE": "VNGRS AngularJS Kampı",
"INTRODUCTION_TEXT": "İstanbul'daki ilk AngularJS Konferansı"
});
$translateProvider.preferredLanguage('tr');
}]);
<h1>{{ "APP_TITLE" | translate }}</h1>
<p>{{ "INTRODUCTION_TEXT" | translate }}</p>
<h1 translate="APP_TITLE"></h1>
<p translate="INTRODUCTION_TEXT"></p>
<h1>VNGRS AngularJS Kampı</h1>
<p>İstanbul'daki ilk AngularJS Konferansı</p>
app.controller('langController', function ($scope, $translate) {
$scope.switchLanguage = function (languageKey) {
$translate.use(languageKey);
};
});
<ul ng-controller="langController">
<li><button ng-click="switchLanguage('tr')">Turkish</button></li>
<li><button ng-click="switchLanguage('en')">English</button></li>
</ul>
Markup
var app = angular.module('myApp', ['ngCookies', 'pascalprecht.translate']);
app.config(['$translateProvider', function ($translateProvider) {
$translateProvider.useCookieStorage();
}]);
// bower install angular-translate-storage-cookie
var app = angular.module('myApp', ['pascalprecht.translate']);
app.config(['$translateProvider', function ($translateProvider) {
$translateProvider.useLocalStorage();
}]);
// bower install angular-translate-storage-local
Cookie de saklamak
localStorage da saklamak
var app = angular.module('angularShop', ['pascalprecht.translate', 'tmh.dynamicLocale']);
app.config(['$translateProvider', 'tmhDynamicLocaleProvider',
function ($translateProvider, locale) {
locale.localeLocationPattern('/components/angular-i18n/angular-locale_{{locale}}.js');
locale.storeKey = $translateProvider.storagePrefix();
locale.useCookieStorage();
}]);
angular.module('angularShop').controller('langController', function ($scope, $translate, tmhDynamicLocale) {
$scope.switchLanguage = function (languageKey) {
$translate.use(languageKey);
tmhDynamicLocale.set(languageKey);
};
});
bower install angular-i18n
bower install angular-dynamic-locale
Kurulum
AngularJs de dinamik olarak $locale değişimine destek yok.
$translateProvider.determinePreferredLanguage()
By Bahattin Çiniç