-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(languages): implement a LanguageService #173
Merged
DedrickEnc
merged 1 commit into
Third-Culture-Software:master
from
jniles:feature-language-service
Mar 9, 2016
Merged
chore(languages): implement a LanguageService #173
DedrickEnc
merged 1 commit into
Third-Culture-Software:master
from
jniles:feature-language-service
Mar 9, 2016
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jniles
force-pushed
the
feature-language-service
branch
from
March 7, 2016 13:06
326c2f4
to
0536667
Compare
@@ -2,11 +2,11 @@ angular.module('bhima.controllers') | |||
.controller('LoginController', LoginController); | |||
|
|||
LoginController.$inject = [ | |||
'$scope', '$translate', '$location', '$http', '$timeout', 'appcache', 'appstate', 'SessionService', | |||
'$scope', '$location', '$http', '$timeout', 'appcache', 'appstate', 'SessionService', 'LanguageService', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need a comma after LanguageService
jniles
force-pushed
the
feature-language-service
branch
from
March 9, 2016 07:18
0536667
to
0608834
Compare
@DedrickEnc, your comments have been fixed. Let me know if there is anything else that needs addressing. |
jniles
force-pushed
the
feature-language-service
branch
2 times, most recently
from
March 9, 2016 11:08
02cf926
to
4bd889b
Compare
This commit implements a LanguageService, responsible to managing the languages and locales throughout the application. In order to do this, several changes have been made: 1. The database `language` table now contains the locales for angular-moment and tmhDynamicLocale. This requires a database rebuild. 2. Three controllers responsible for languages now use LanguageService. These are: 1. ApplicationController 2. LoginController 3. SettingsController USAGE If you want to use the LanguageService to display or set languages from a controller, the API is quite simple. Languages are loaded from the database on startup, and can be accessed via the `read()` function as shown below. ```js angular.module('bhima.controllers') .controller('SomeController', [ 'LanguageService', function (Languages) { var vm = this; // reading languages from the service Languages.read() .then(function (languages) { vm.languages = languages; }); // setting the application language based on a locale key Languages.set(key); // get the current language var languageKey = Langauges.get(); }]); ``` Closes #160.
jniles
force-pushed
the
feature-language-service
branch
from
March 9, 2016 11:12
4bd889b
to
5c1727b
Compare
@DedrickEnc , updated with the important changes you suggested. |
As soon as all tests passed, it will be merged. |
DedrickEnc
added a commit
that referenced
this pull request
Mar 9, 2016
chore(languages): implement a LanguageService
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit implements a LanguageService, responsible to managing the
languages and locales throughout the application. In order to do this,
several changes have been made:
language
table now contains the locales forangular-moment and tmhDynamicLocale. This requires a database rebuild.
These are:
USAGE
If you want to use the LanguageService to display or set languages from
a controller, the API is quite simple. Languages are loaded from the
database on startup, and can be accessed via the
read()
function asshown below.
Closes #160.