Angular translate incluido, Componentes core traducibles

This commit is contained in:
Juan Ferrer Toribio 2016-12-15 13:57:45 +01:00
parent 58d8176a42
commit 2920f7acda
21 changed files with 44 additions and 33 deletions

View File

@ -3,6 +3,7 @@ import {bootstrap} from './bootstrap';
import * as spliting from './spliting';
import * as routes from './configroutes';
import * as run from './run';
import * as configNgTranslate from './translate';
import * as components from './components';
import title from './styles/title.css'

View File

@ -14,5 +14,4 @@ export const bootstrap = () => {
throw new Error("element is not defined");
}
ng.bootstrap(_element, [SALIX]);
};

View File

@ -2,7 +2,6 @@ import * as core from 'core';
import * as spliting from './spliting';
import * as deps from './spliting/deps.json';
function loader(module) {
function load($ocLazyLoad, $q){
return $q((resolve) => {

View File

@ -3,4 +3,4 @@ import * as core from 'core';
import {NAME as CORE} from 'core';
export const NAME = 'salix';
export const module = vendors.ng.module(NAME,[CORE]);
export const module = vendors.ng.module(NAME, [CORE]);

View File

@ -1,10 +1,9 @@
import {ng} from 'vendor';
import {module} from './module';
export const run = function($rootScope){
$rootScope.$on('$viewContentLoaded',()=>{
componentHandler.upgradeAllRegistered();
})
export const run = function($rootScope) {
$rootScope.$on('$viewContentLoaded',()=>{
componentHandler.upgradeAllRegistered();
})
}
run.$inject=['$rootScope'];
module.run(run);
run.$inject = ['$rootScope'];
module.run(run);

View File

@ -0,0 +1,9 @@
import {module} from './module';
export const configNgTranslate = function($translateProvider) {
$translateProvider
.translations('es', {/* Traducciones */})
.preferredLanguage('es');
}
configNgTranslate.$inject = ['$translateProvider'];
module.config(configNgTranslate);

View File

@ -1,3 +1,3 @@
<button type = "*[typeName]*" class="*[className]*" *[enabled]* >
<button type = "*[typeName]*" class="*[className]*" *[enabled]* translate>
*[label]*
</button>

View File

@ -1,4 +1,4 @@
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect">
<input type="checkbox" name="*[name]*" class="*[className]*" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* *[focus]*>
<span class="mdl-checkbox__label">*[label]*</span>
<span class="mdl-checkbox__label" translate>*[label]*</span>
</label>

View File

@ -1,5 +1,5 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<select class="mdl-textfield__input" class="*[className]*" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* ng-transclude>
</select>
<label class="mdl-textfield__label">*[label]*</label>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -1,4 +1,4 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input *[className]*" type="text" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]*>
<label class="mdl-textfield__label">*[label]*</label>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -4,5 +4,3 @@ import {getModuleName,getVendorDependencies} from './util';
const DEPENDENCIES = getVendorDependencies(vendors)
export const NAME = getModuleName('core');
export const module = vendors.ng.module(NAME,DEPENDENCIES);

View File

@ -1,4 +1,4 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="*[className]*" type="password" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* *[focus]*>
<label class="mdl-textfield__label">*[label]*</label>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -1,2 +1,2 @@
<input type="radio" class="*[className]*" name="*[name]*" ng-model="*[model]*.*[name]*" *[enabled]*>
<span class="mdl-radio__label">*[text]*</span>
<span class="mdl-radio__label" translate>*[text]*</span>

View File

@ -6,16 +6,16 @@ export const NAME = util.getProviderName ('RoutesLoader')
function $get($http){
let script = document.currentScript || (() => {
let scripts = document.getElementsByTagName ('script');
return scripts[scripts.length - 1];
}) ();
let routesCdn = script.getAttribute ('routes-cdn');
return $http
({
method: 'GET',
url: routesCdn
})
let scripts = document.getElementsByTagName ('script');
return scripts[scripts.length - 1];
}) ();
let routesCdn = script.getAttribute ('routes-cdn');
return $http({
method: 'GET',
url: routesCdn
});
}
$get.$inject = ["$http"];
@ -25,4 +25,3 @@ export class RoutesLoader{ constructor () {} }
RoutesLoader.prototype.$get = $get;
var routes = new RoutesLoader ();
_module.provider (NAME, () => routes)

View File

@ -4,7 +4,7 @@ export const NAME = 'vnRule';
export function directive() {
return {
restrict: 'A',
link: function (attrs, element){
link: function (attrs, element) {
}
};
}

View File

@ -1,2 +1,2 @@
<input type="submit" class="*[className]*" value="*[label]*" *[enabled]*>
<input type="submit" class="*[className]*" translate-attr="{value: '*[label]*'}" value="*[label]*" *[enabled]*>
</input>

View File

@ -1,4 +1,4 @@
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="*[className]*" type="*[type]*" name="*[name]*" ng-model="*[model]*" rule="*[rule]*" *[enabled]* *[focus]*>
<label class="mdl-textfield__label">*[label]*</label>
<label class="mdl-textfield__label" translate>*[label]*</label>
</div>

View File

@ -13,5 +13,5 @@
</form>
</div>
</div>
<vn-snackbar id="snackbar"/></vn-snackbar>
<vn-snackbar id="snackbar"></vn-snackbar>
</div>

View File

@ -10,6 +10,7 @@
},
"dependencies": {
"angular": "^1.5.8",
"angular-translate": "^2.13.1",
"angular-ui-router": "^1.0.0-beta.3",
"express": "^4.14.0",
"material-design-lite": "^1.2.1",

View File

@ -0,0 +1,5 @@
import * as _ngTranslate from 'angular-translate';
export const ngTranslate = {
name: 'pascalprecht.translate'
};

View File

@ -1,4 +1,5 @@
export * from './angular-vendor';
export * from './oclazyload-vendor';
export * from './uirouter-vendor';
export * from './angular-translate-vendor';
export * from './materialdesignlite-vendor';