Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

When i hit save button i get the undefined method `create' for Psych::Visitors::YAMLTree:Class #5

Open
mihaj opened this issue Dec 4, 2013 · 5 comments

Comments

@mihaj
Copy link

mihaj commented Dec 4, 2013

I18nYamlEditor::TransformationError at /update
Failed to nest key: "zh-tw.datetime.distance_in_words.x_days.one"

It looks like my YAMLs are not properly structured?

example:

zh-cn:
  date:
      order:
      - :year
      - :month
      - :day
  datetime:
      distance_in_words:
        x_days: "%{count} 天"
        about_x_months: "大約 %{count} 個月"
        x_months: "%{count} 个月"
        about_x_hours: "大约 %{count} 小时"
        about_x_years: "大约 %{count} 年"
        almost_x_years: "接近 %{count} 年"
        half_a_minute: "半分钟"
        less_than_x_minutes: "不到 %{count} 分钟"
        less_than_x_seconds: "不到 %{count} 秒"
        over_x_years: "%{count} 年多"
        x_minutes: "%{count} 分钟"
        x_seconds: "%{count} 秒"
...

I have complete en.yml, but others are missing the translations.

Thanks

@mihaj
Copy link
Author

mihaj commented Dec 5, 2013

Ok, fixed the above error, by removing datetime: from yml.

But now i get:

NoMethodError at /update
undefined method `create' for Psych::Visitors::YAMLTree:Class

Ruby /home/miha/.rvm/gems/ruby-2.0.0-p247/gems/psych-2.0.2/lib/psych.rb: in dump, line 407
Web POST 0.0.0.0/update

@vangberg
Copy link
Contributor

vangberg commented Jan 8, 2014

Hello

Can you provide an example yml file?

@mihaj
Copy link
Author

mihaj commented Jan 8, 2014

Hi.

This are first lines of en.yml

#encoding: utf-8
en:
  date:
    order:
    - :year
    - :month
    - :day
  datetime:
    distance_in_words:
      x_days:
        one: "1 day"
        other: "%{count} days"
      about_x_months:
        one: "about 1 month"
        other: "about %{count} months"
      x_months:
        one: "1 month"
        other: "%{count} months"
      about_x_hours:
        one: "about 1 hour"
        other: "about %{count} hours"
      about_x_years:
        one: "about 1 year"
        other: "about %{count} years"
      almost_x_years:
        one: "almost 1 year"
        other: "almost %{count} years"
      half_a_minute: "half a minute"
      less_than_x_minutes:
        one: "less than 1 minute"
        other: "less than %{count} minutes"
      less_than_x_seconds:
        one: "less than 1 second"
        other: "less than %{count} seconds"
      over_x_years:
        one: "over %{count} years"
        other: "over 1 year"
      x_minutes:
        one: "%{count} minute"
        other: "%{count} minutes"
      x_seconds:
        one: "%{count} seconds"
        other: "%{count} seconds"
  support:
    array:
      words_connector: ", "
      last_word_connector: " or "
  will_paginate:
    previous_label: "← Previous"
    next_label: "Next →"
    page_gap: "…"

@mihaj
Copy link
Author

mihaj commented Feb 10, 2014

Any hints?

@mihaj
Copy link
Author

mihaj commented Apr 13, 2014

Even with 1.0.2 version of IYE and Psych 2.0.5 I still get the same error. :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants