Giter VIP home page Giter VIP logo

onesky-rails's People

Contributors

demental avatar jkz avatar rubyluk avatar vlmh avatar yashasvj avatar

Stargazers

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

Watchers

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

onesky-rails's Issues

onesky.yml is not ERB enabled

While the i18n_one-sky gem the one_sky.yml is parsed through ERB, this is not the case with onesky-rails, which leads (in my case but I guess I'm not the only one) to a sensitive data issue.
As I use figaro to keep sensitive values centralized, I would like to do the same with the one sky gem, and embed ERB tags in the onesky.yml.

Unless ERB parsing was removed for a reason ? Please let me know. Anyway I'd like to submit a PR for this.

Filename renamig

There is a problem when downloading files that does not fit the standard style (en.yml), for instance, devise.en.yml.

When you use the gem to download the file, the name is not translated to the suitable locale, f.ex. if we want to translate it to spanish the name is not renamed to devise.es.yml and remains as devise.en.yml

Doesn't work on Rails 4.2

Gem doesn't work on rails 4.2 because dependencies.

onesky-rails (>= 0) ruby depends on
onesky-ruby (> 1.0.0) ruby depends on
rest-client (
> 1.7.2) ruby

Where rails 4.2 uses rest-client 1.8.0

Onesky::Errors::BadRequestError: 400 Bad Request - Invalid source file when not found

As the gem is using the list of files on the disk, when running the rake onesky:download_base task, in case there is a new file on the local disk, it failles with a 400 Bas Request.

  1. Update the OneSky API in order to return a 404 error instead of 400 (Here the request is well formed, so it cannot be a 400 error, but 404 Not Found)
  2. When the 404 error occurs, warn in the console, but continue.

Any plans on publishing 1.4.1 on RubyGems?

1.4.1 is described in the CHANGELOG (not as "future release"):
db09c0b

However, the last version of onesky-rails on RubyGems is 1.4.0: https://rubygems.org/gems/onesky-rails

Are there any plans to fix that, or do I need to point to the GitHub repository in my Gemfile?

The fix that was added in 1.4.1 (Upgrading the onesky-ruby dependancy gem) helps resolve a gem version lock conflict, and will allow our project to upgrade the rest-client gem and support recent versions of other gems that use it.

Update base language file

Given I have updated the base language texts, when I run rake onesky:download or rake onesky:upload it should also update the base language files.

Wrong format on downloading translation from API where array have first value empty

Hi,

I don't know what changed these days, but I have problems with some of my translations. Just happens to the ones that are arrays of values and the first value is empty. I have tried older versions of the gem and still happens the same. Do you think it's related to the API? Was working few days ago. Here an example:

Original file from the rails i18n repository: https://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/en.yml

abbr_month_names:
- 
- Jan
- Feb
- Mar
- Apr
- May
- Jun
- Jul
- Aug
- Sep
- Oct
- Nov
- Dec

Can be uploaded and translated without problems. Errors appear when downloading the translation.

abbr_month_names:
? "12"
: dic
? "0"
: ~
? "1"
: ene
? "2"
: feb
? "3"
: mar
? "4"
: abr
? "5"
: may
? "6"
: jun
? "7"
: jul
? "8"
: ago
? "9"
: sep
? "10"
: oct
? "11"
: nov

Tried changing the format of original file to an array like:

[, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]

or even

[~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]

but no luck.

Any tips on how to solve it?

Issue with file names with one_sky:download

I started using onesky-rails in replacement of i18n-one_sky today, because as I removed the 'Default' from my translation source files, I encountered the error mentionned in this issue : onesky/i18n-one_sky-ruby#8

So here I am. And for some reason (due to missing information in the api response suposately) Here is the output of the task onesky:download :

demental$ rake onesky:download
onesky_en_GB/
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
  en-GB.yml
onesky_es_UY/
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
  es-UY.yml
onesky_pt_PT/
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
  pt-PT.yml
onesky_es_419/
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml
  es-419.yml

As I suspected with this output, each downloaded translation file would replace the previous one, so while it should comply to the base locale file structure, it doesn't, and I can't properly download the translations.

I suggest one should name the downloaded files after the existing base file structure, and not after the API attachment response. I'll try to submit a PR within the end of the day to achieve this.

Implement the handling of tables in translation files

Given the base language of the application is English
And the application is translated in French
And an English translation YAML file contains a table as the following:

en:
  days:
    - Monday
    - Tuesday
    - Wednesday
    - Tuesday
    - Friday
    - Saturday
    - Sunday

When I upload this file to the OneSky platform
And I download the French translation files
Then I see the following file:

fr:
  days:
    ? "1"
    : Mardi
    ? "0"
    : Lundi
    ? "2"
    : Mercredi
    ? "3"
    : Jeudi
    ? "4"
    : Vendredi
    ? "5"
    : Samedi
    ? "6"
    : Dimanche

While I expect to see the following file:

fr:
  days:
    - Lundi
    - Mardi
    - Mercredi
    - Jeudi
    - Vendredi
    - Samedi
    - Dimanche

BUG: File renamed on download

Given I'm using languages English and French. In the case I have a file menu.yml, the French file is renamed as mfru.yml.
The en has been replaced by fr while it shouldn't.

Filename conflicts

I have a folder structure for organizing my translations, but sometime the files have the same filename - and then I only get to keep one of the files on onesky.

Would there be a way to append to the filename based on folder structure?

Or keep multiple files with same filename? (Guess that would lead to problems with duplicates).

Example: how should it understand the difference between:

config/locales/views/users.sv.yml and config/locales/views/admin/users.sv.yml

or is the only option to rename one of the file?

Do not add comment on header

My opinion is that files downloaded using the gem should be identical to those downloaded manually via the web site.

In our team, some of us use the rake tasks but others still download files via the website. This makes the header comment to be added and deleted continuously in our Git version control:

captura de pantalla 2015-09-09 a las 10 34 40

At least it should be optional and configurable.

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.