Skip to content
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

Fixes i18Find() on meteor 1.2 #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Developed by <a href="http://www.meteorspark.com"><img src="http://www.meteorspa
**Step 1:** Install tap-i18n-db:

```bash
$ meteor add tap:i18n-db
$ meteor add phowat:i18n-db
```

**Step 2:** Initialize the collection you wish to translate with `new TAPi18n.Collection`
Expand Down
8 changes: 4 additions & 4 deletions package.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package.describe({
name: 'tap:i18n-db',
summary: 'Internationalization for Meteor Collections',
version: '0.4.0',
git: 'https://github.com/TAPevents/tap-i18n-db'
name: 'phowat:i18n-db',
summary: 'Internationalization for Meteor Collections. Forked from tap:i18n-db',
version: '0.4.1',
git: 'https://github.com/phowat/tap-i18n-db'
});

Package.on_use(function (api) {
Expand Down
3 changes: 2 additions & 1 deletion tap_i18n_db-common.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ commonCollectionExtensions = (obj) ->
throwError new Meteor.Error(400, "TAPi18n is not supported"), attempted_operation, callback

isSupportedLanguage = (lang, attempted_operation, callback) ->
if lang in TAPi18n.conf.supported_languages
supported_languages = TAPi18n.conf.supported_languages || Object.keys TAPi18n.getLanguages()
if lang in supported_languages
return

throwError new Meteor.Error(400, "Not supported language: #{lang}"), attempted_operation, callback
Expand Down
2 changes: 1 addition & 1 deletion tap_i18n_db-server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ share.i18nCollectionExtensions = (obj) ->
dialect_of = share.helpers.dialectOf current_language
collection_base_language = @._base_language

supported_languages = TAPi18n.conf.supported_languages
supported_languages = TAPi18n.conf.supported_languages || Object.keys TAPi18n.getLanguages()
if current_language? and not (current_language in supported_languages)
throw new Meteor.Error(400, "Not supported language")

Expand Down