Giter Club home page Giter Club logo

i18n-node-angular's Introduction

Noteable GitHub Projects

  1. Kitten Science
    Organization for everything relating to Kitten Scientists v2 for Kittens Game.

  2. node-scripts-docs
    Create a reference documentation for your scripts in package.json.

  3. js-utils
    Common utilities for JS/TS projects.

  4. containers
    Pre-built container images for IaC tasks.

  5. PlantDB 🩺
    A framework to maintain a log for plants.

  6. The Alliance (Titan & Rebels Chipdisc #1)
    A chipdisc by Titan & Rebels built in 2006.

  7. OmniUDP
    UID broadcaster for OmniKey 5321 and other RFID readers.

  8. Nodes.js
    A node-based playground for JavaScript.

  9. docker-cloudflare-dns
    Updates CloudFlare DNS with IP addresses of running Docker containers.

Project Templates

A set of templates to start a project with modern yarn.

  1. yarn3-hugo
    Hugo static website.

  2. yarn3-monorepo
    A JS/TS monorepo.

  3. yarn3-typescript-nodejs-esbuild
    A NodeJS project that uses esbuild.

  4. yarn3-typescript-web-vite
    A browser project that uses vite.

  5. aws-lambda-nodejs
    JavaScript project with AWS Lambda NodeJS runtime target.

  • ⭐ = Under active maintenance
  • 🩺 = Degraded, needs work

i18n-node-angular's People

Contributors

marzoli avatar oliversalzburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

i18n-node-angular's Issues

User selected locale support

This is GREAT project!

Is there support for runtime locale switching using the users setting on the client? I could then store this setting in a cookie or localStorage for retrieval. Would this cause a page refresh?

Thanks

Typos, nitpicking :)

  1. sendFile

    express deprecated res.sendfile: Use res.sendFile instead 
    node_modules/i18n-node-angular/i18n-node-routes.js:84:12
    
  2. Typo:

    console.log( "Insured: " + i18n.__( "My translation phrase" ) );` // Should read as below
    console.log( "Ensured: " + i18n.__( "My translation phrase" ) );`
    
  3. The implementation should be labeled as the code implementation in another rubric perhaps, at least separate from the usage details

Usage with ng-bind?

How can I translate values inserted with ng-bind? Thanks

<span ng-bind="(Hello | i8n) "></span>

Load order error in your code?

Hi!

I was trying to use your example (great idea btw) - but i suspect it is only luck you got the i18nService code to perform as intended.

As in your example code for i18nService - you can not be guaranteed that the ensureLocaleIsLoaded has sucessfully returned the translations and added them to $rootScope.i18n before i18nService.__ is called.

Implicit jQuery requirement

You may just want to document that there is an implicit requirement to have jQuery included before angular as the jqlite doesn't support selectors like

angular.element("body")

as is found in i18n-node-angular.js:42

Thanks,
Todd

Bug in documentation

I think there must be bug in documentation in router resolve function...

"i18nData": function( i18n ) { return i18n.ensureLocaleIsLoaded().promise; }

should be:

"i18nData": function( i18n ) { return i18n.ensureLocaleIsLoaded(); }

This small mistake took me 2 hours hehe :D

Beating my head against the wall a bit with MEAN stack and this

I'm using http://www.mean.io/ and trying to implement this. I've successfully implemented the Express part, but having trouble with the Angular part.

The main difference that I see is that it uses ui-router rather than ngRoute. It shouldn't matter too much since you can set resolve there just as well.

I've installed your module with Bower, and I'm doing this:
angular.module('mean', ['ngCookies', 'ngResource', 'i18n', 'ui.bootstrap', 'ui.router', 'mean.system', 'mean.articles']);

It works perfectly until I add i18n, and the i18n breaks everything with:

http://docs.angularjs.org/error/$injector/modulerr?p0=mean&p1=undefined

Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.14/$injector/modulerr?p0=mean&p1=Error%3A%2…org%2F1.2.14%2F%24injector%2Fmodulerr%3Fp0%3Di18n%26p1%3DError%253A%2520%2...<omitted>...5) angular.js:36 (anonymous function) angular.js:36 (anonymous function) angular.js:3702 r angular.js:322 e angular.js:3668 $b angular.js:3608 Zb.c angular.js:1338 Zb angular.js:1353 (anonymous function) init.js:8 a angular.js:2402 (anonymous function) angular.js:2673 r angular.js:329 $c.c angular.js:2672

Is there any clue you could give me?

Setting up resolve in MEAN.io

I'm using mean.io, which works with a very specific file hierarchy and also makes use of ui-router.

In its' app.js file I do:

angular.module('mean', ['ngCookies', 'ngResource', 'i18n', 'ui.bootstrap', 'ui.router', 'mean.system', 'mean.articles']);

Which seems to work great.

Then, there's a file called config.js where this happens:

'use strict';

//Setting up route
angular.module('mean').config(['$stateProvider', '$urlRouterProvider',
  function($stateProvider, $urlRouterProvider) {
    // For unmatched routes:
    $urlRouterProvider.otherwise('/');

    // states for my app
    $stateProvider
      .state('all articles', {
        url: '/articles',
        templateUrl: 'views/articles/list.html'
    })
      .state('create article', {
        url: '/articles/create',
        templateUrl: 'views/articles/create.html'
    })
      .state('edit article', {
        url: '/articles/:articleId/edit',
        templateUrl: 'views/articles/edit.html'
    })
      .state('article by id', {
        url: '/articles/:articleId',
        templateUrl: 'views/articles/view.html'
    })
      .state('home', {
        url: '/',
        templateUrl: 'views/index.html'
    });
}
]);

//Setting HTML5 Location Mode
angular.module('mean').config(['$locationProvider',
  function($locationProvider) {
    $locationProvider.hashPrefix('!');
}
]);

This seems to be the place to resolve i18nData, but I'm still a bit unfamiliar with dependencies in Angular, and I can't seem to figure this part out.

Unable to get the i18n service to work properly in angular JS

Hi Oliver,

First of all an excellent project and just what I needed. I am having problems in getting the locale set for the angular JS controller in the first instance. I was using i18n-node before and that has the loading the locale properly (using cookies) and was loading the appropriate translation. For the Angular JS part I am following the same steps as you mention in your instructions , but unless I again select the locale and set it using res.setLocale() the Angular JS partials are not getting translated .. I see just the keys..

What could I be doing wrong. My project code can be referenced here.
https://github.com/tsukhu/rwd-spa-alljs-app/blob/master/routes/routes.js
https://github.com/tsukhu/rwd-spa-alljs-app/blob/master/public/travelapp/travelapp.js

Any help will be greatly appreciated. Also this happens only initially when the cookie is not set for the locale.

Watcher for locale not working anymore with "dist" version

I had a function that I used to set the locale if a user wanted

<html ng-app="app" i18n-locale="{{ i18n.getLocale() }}">
....
(function() {
    angular.module("app")
        .factory('$global', ['i18n', function(i18n) {
            return {
                setLocale: function(localID) {                
                    $rootScope.i18nLocale = localID;
                }
            };
        }]);
}());

Trying to set the locale manually does not work using this snippet:

// In the template
<button ng-click="setLocale('en')">
    Force client-side locale: en
  </button>

// in the controller
    self.setLocale = $global.setLocale;

Am I doing something wrong? Has something changed?

Deprecated statement in Express 4.8.8

Hello, thank you for a great tool!
Although i have a warning message:
express deprecated res.sendfile: Use res.sendFile instead node_modules/i18n-node-angular/i18n-node-routes.js:84:12

Setting the local on the fly?

How does one set the local on the fly in a template and in a controller? I tried setting "i18n-locale=''de", but that did not work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.