Giter Club home page Giter Club logo

teachur-app's Introduction

teachur-app

Install instructions

First, clone the repository and enter the folder you cloned the app to.

sudo npm install
sudo bower install
grunt
node .

Open http://localhost:8080 in your browser.

How Translation works

  • Translation works with the angular-translate library
  • There is module that initiates the language negotiation that can be found in /public/modules/teachur.I18n.js
  • That module is added as a dependency of the teachur module.
  • By default the english language is set
  • For each of the enabled languages there ia a translation file that can be found in /public/i18n/
  • Each of this files follow the name convention resources-locale_[country-code].js
  • When the user changes the languge using the language switcher, the associated translation file is loaded

Translation Strings

Now that the I18n is implemented no text should be harcoded in the views. Instead of harcoding text, a translation key needs to be placed added to all of the translation files with the appropiate translation. If no translation is available for one of the languages just use the english value.

When adding new translation strings to the files you need to make sure that that translation key or value is not already in the files, maybe other developer has tu put the same text on another screen. So just spend some seconds and do a quick search to make sure you are not creating any duplicate keys or values

Translation Strings Naming Convention
  • use lower case for the keys
  • user - to separate words
  • in case of working on a section or component make use of a word as a namespace. So for instance all the fields in the create objective form have this prefix objectives.create.some-field
How to add translation strings

There are two ways of adding the translation strings and that will depend on the usecase.

  1. it can be set as an attribute. This method is useful when the text is the only thing that is going to be inside the tag. ie an h1 tag
<h1 data-translate="translate-this-text"><h1>
<!-- result -->
<h1>This text is translated<h1>

  1. it can be set inside curly brackets, this method is useful when you don't want the whole content of the tag is replaced by the translation string
<span><i class="some-fancy-icon"></i>{{"translate-this-text" | translate}}</span>
<!-- result -->
<span><i class="some-fancy-icon"></i>This text is translated</span>

Troubleshooting

{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }

First make sure that you have mongoose installed

npm install [email protected]

Second change bson reference as described here: http://stackoverflow.com/questions/28651028/cannot-find-module-build-release-bson-code-module-not-found-js-bson

teachur-app's People

Contributors

coderbag avatar

Watchers

 avatar

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.