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

Lost messages when contexts are used #27

Open
akimd opened this issue Mar 15, 2024 · 0 comments
Open

Lost messages when contexts are used #27

akimd opened this issue Mar 15, 2024 · 0 comments

Comments

@akimd
Copy link

akimd commented Mar 15, 2024

I have just discovered that this project is no longer maintained. I'll therefore work to migrate to the recommended system.

However, for the record, when there are two identical msgids, one with a context and the other without, the one without context is ignored.

It is unique_translations that drops the missing translations.

mk = ->(ctx, id, str) {
    res = GetPomo::Translation.new
    res.msgctxt = ctx if ctx
    res.msgid = id
    res.msgstr = str
    res
}

translations = [
    mk.(nil, 'Amount', 'Montant'),
    mk.('Invoice', 'Amount', 'Montant'),
]
GetPomo.unique_translations(translations)

=>

[#<GetPomo::Translation:0x00007ffb57cac218
  @msgctxt="Invoice",
  @msgid="Amount",
  @msgstr="Montant">]
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

1 participant