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

Greek long date format translation with grammatical cases #1106

Open
anthony0030 opened this issue Oct 19, 2023 · 5 comments
Open

Greek long date format translation with grammatical cases #1106

anthony0030 opened this issue Oct 19, 2023 · 5 comments

Comments

@anthony0030
Copy link

Same as #284 but for Greek.

@anthony0030
Copy link
Author

I solved this by creating file config/locales/datetime.el.rb with content:

{
  :el => {
    :date => {
      :month_names => lambda { |date_or_time, opts|
        if opts[:format] =~ /(%d|%-d|%e)(.*)(%B)/
          [nil, 'Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου']
        else
          [nil, 'Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος']
        end
      }
    }
  }
}

@renatodeleao
Copy link

renatodeleao commented Aug 18, 2024

Shouldn't this be fixed internally instead of adding a workaround or is this a debatable language thing? (I'm not greek 🤷, and languages have strict rules but that change over time ).

Just stumble upon this because I have an email composer with a live preview in a javascript app that uses Intl.DateTimeFormat which outputs the months "correctly" — at least according to the OP — but the email itself is sent by a rails app which uses I18n.l under the hood and outputs the months differently.

Anyways, thanks for the workaround!
Cheers ✌️

@anthony0030
Copy link
Author

Hi @renatodeleao,

This is definitely not a debatable thing, I was born and raised in Greece and still live here.
When I found this bug, I needed to make a quick workaround and apply the fix to launch a project. Does anyone know someone who can help make this into a pull request? I have some experience with RoR but not enough to know exactly where and how to apply this specific code.

Say you have the date "28th of February". in English, February stays the same even tho the 28th day belongs to February in the sentence in Greek the word February changes to become the belonging version of that word, and the of can be removed as it is implied. Greek is so strange. It is also a gendered language so a chair is a she and a table is an it. People talking to people above them or older than them or with specific jobs lawyer/doctor/judge/etc in the first person as plural and in the third person normally. PERFECT LANGUAGE IF YOU HAVE DYSLEXIA!

Sorry for the rant.

@renatodeleao
Copy link

renatodeleao commented Aug 19, 2024

@anthony0030 No problem, and thanks for clarifying!

EDIT: As Polish, since this is dynamic according the context on where the month name is used, the solution cannot be just tweak the language .yml. In the Polish thread there a few attempts, but nothing was ever implemented in the core to handle these cases. IGNORE THIS, the best thing todo is to reopen this issue. 👇

The code to change should be here:

month_names:
-
- Ιανουάριος
- Φεβρουάριος
- Μάρτιος
- Απρίλιος
- Μάιος
- Ιούνιος
- Ιούλιος
- Αύγουστος
- Σεπτέμβριος
- Οκτώβριος
- Νοέμβριος
- Δεκέμβριος

Do you if this rule also applies to the Cyprus greek (el-CY) variant?

month_names:
-
- Ιανουάριος
- Φεβρουάριος
- Μάρτιος
- Απρίλιος
- Μάιος
- Ιούνιος
- Ιούλιος
- Αύγουστος
- Σεπτέμβριος
- Οκτώβριος
- Νοέμβριος
- Δεκέμβριος

renatodeleao added a commit to renatodeleao/rails-i18n that referenced this issue Aug 19, 2024
According to born a raised greek:
svenfuchs#1106 (comment)

It aligns the output with native javascript internationalization class Intl.DateTimeFormat, which should strictly by the language rules

Co-Authored-By: Anthony Veaudry  <[email protected]>
@anthony0030 anthony0030 reopened this Aug 19, 2024
@anthony0030
Copy link
Author

@renatodeleao, I reopened this issue as recommended.

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

No branches or pull requests

2 participants