# YAML for language with only "other" plural form incompatible with Rails

**URL:** <https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259>\
**Category:** Developers\
**Created:** [October 25, 2024, 7:29pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259 "2024-10-25T19:29:14Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![flagman](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/flagman/32/1754_2.png) [@flagman](https://community.transifex.com/u/flagman)\
**Post date:** [October 25, 2024, 7:29pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/1 "2024-10-25T19:29:14Z")

</div>

In my Rails project, I have translation keys with plural forms in the source language of English such as:

```auto
en:
  errors:
    messages:
      not_saved:
        one: '1 error prohibited this %{resource} from being saved:'
        other: "%{count} errors prohibited this %{resource} from being saved:"

```

I have this string translated into Chinese (Simplified) zh\_CN. Upon `tx pull`, my translation file contains:

```auto
zh_CN:
  errors:
    messages:
      not_saved:
        other: "发生 %{count} 个错误，导致%{resource}保存失败："

```

This causes an error on use with Rails:

```auto
ActionView::Template::Error:
       translation data {:other=>"发生 %{count} 个错误，导致%{resource}保存失败："} can not be used with :count => 1. key 'one' is missing.

```

What Rails is expecting here is:

```auto
zh-CN:
  errors:
    messages:
      not_saved: "发生 %{count} 个错误，导致%{resource}保存失败："

```

Is there a way to have the file in the format that Rails wants, or am I just gonna have to post-process this somehow?

---

<div class="post-metadata">

**Author:** ![flagman](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/flagman/32/1754_2.png) [@flagman](https://community.transifex.com/u/flagman)\
**Post date:** [October 25, 2024, 8:11pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/2 "2024-10-25T20:11:59Z")

</div>

Actually, I believe this behaviour is due to my test environment loading `I18n` but not the pluralization rules provided by `rails-i18n`. So nevermind.

---

<div class="post-metadata">

**Author:** ![colvera](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/colvera/32/3187_2.png) [@colvera](https://community.transifex.com/u/colvera)\
**Post date:** [October 25, 2024, 8:13pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/3 "2024-10-25T20:13:40Z")

</div>

Hi @flagman

My name is Carlos, thanks for contacting Transifex support. Are you still experiencing the issue in your plural translation?

I’m attendant to your comments,  
Kind regards

---

<div class="post-metadata">

**Author:** ![Sandy\_DLR](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/sandy_dlr/32/2498_2.png) [@Sandy\_DLR](https://community.transifex.com/u/Sandy_DLR)\
**Post date:** [October 25, 2024, 8:20pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/4 "2024-10-25T20:20:23Z")

</div>

Hello! Could you please share your .tx/config file with us? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![syl](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@syl](https://community.transifex.com/u/syl)\
**Post date:** [November 29, 2024, 12:25pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/5 "2024-11-29T12:25:00Z")

</div>

> [@Sandy\_DLR](#):
>
> .tx/config file

Why this file is important here? I’m seriously interested how it influences recognition of plural form.

---

<div class="post-metadata">

**Author:** ![Mylon](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/mylon/32/2139_2.png) [@Mylon](https://community.transifex.com/u/Mylon)\
**Post date:** [November 29, 2024, 1:32pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/6 "2024-11-29T13:32:17Z")

</div>

Hello @syl,

After examining the issue shown in the images, I don’t believe the tx/config file is necessary to identify the core problem, but having it is useful for us CSEs to recreate issues accurately and better understand and resolve them.

The issue appears to be with the YAML structure and nesting of the translation files rather than the Transifex configuration.

The main problem visible in the screenshots is that Rails expects a YAML structure that is different from what’s being provided. Specifically:

1. The current problematic structure has:

```yaml
zh_CN:
  errors:
    messages:
      not_saved:
        other: "发生 %{count} 个错误,导致%{resource}保存失败:"

```

1. While Rails expects:

```yaml
zh_CN:
  errors:
    messages:
      not_saved: "发生 %{count} 个错误,导致%{resource}保存失败:"

```

The issue stems from the additional nesting of the `other` key, which appears to be coming from the plural form handling in the English source file. This is a structural YAML issue rather than a Transifex configuration problem.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![syl](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@syl](https://community.transifex.com/u/syl)\
**Post date:** [November 29, 2024, 2:14pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/7 "2024-11-29T14:14:07Z")

</div>

Which of your tools should be used to get feedback about wrong syntax for plural form? I mean Transifex API, your GitHub Action or what is able to help here? Do you support this kind of error or warning?

---

<div class="post-metadata">

**Author:** ![colvera](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/colvera/32/3187_2.png) [@colvera](https://community.transifex.com/u/colvera)\
**Post date:** [November 29, 2024, 4:02pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/8 "2024-11-29T16:02:34Z")

</div>

**Subject:** Assistance with Plural Forms Validation

Hi @Syl,

Thank you for reaching out to Transifex Support. My name is Carlos, and I’ll be assisting you with your inquiry.

Unfortunately, at this time, Transifex does not support validating errors or warnings related to plural forms directly within the platform. I completely understand how important this functionality is, and I regret any inconvenience this may cause.

To validate pluralized strings, you would need to perform this step outside of Transifex before pushing the content. If the pluralized string does not align with the expected structure, Transifex will format it as a regular string.

I’m here to help and ensure you have all the support you need. Please don’t hesitate to share any additional questions or concerns, and I’ll do my best to assist further.

Best regards,

Carlos

---

<div class="post-metadata">

**Author:** ![syl](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@syl](https://community.transifex.com/u/syl)\
**Post date:** [November 29, 2024, 4:05pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/9 "2024-11-29T16:05:46Z")

</div>

No confirmation of any kind that Transifex recognized 5 or 15 pluralized strings after pushing new strings to base language?

Thank you again for a great support here.

---

<div class="post-metadata">

**Author:** ![colvera](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.transifex.com/colvera/32/3187_2.png) [@colvera](https://community.transifex.com/u/colvera)\
**Post date:** [November 29, 2024, 4:15pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/11 "2024-11-29T16:15:14Z")

</div>

Hi @syl

At the moment there is no confirmation on Transifex side that let you know how many pluralized strings were detected. What you can do is to filter in the Editor using `pluralized:yes` filter, this will show you all the pluralized strings inside an specific resource.

 ![Screenshot 2024-11-29 at 10.14.16 a.m.](https://canada1.discourse-cdn.com/flex030/uploads/transifex/original/2X/9/9c6a37afc4bf36d9669cd63323dabbc478407413.png)

Best regards,

---

<div class="post-metadata">

**Author:** ![syl](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@syl](https://community.transifex.com/u/syl)\
**Post date:** [November 29, 2024, 4:17pm UTC](https://community.transifex.com/t/yaml-for-language-with-only-other-plural-form-incompatible-with-rails/4259/12 "2024-11-29T16:17:25Z")

</div>

Yes, I know about `pluralized:yes` but it is available for translators and not for developers (scripts, etc.).

Thank you again for support.
