Skip to content

Prepare Hindi translations - #7927

Open
aitap wants to merge 7 commits into
mega-hindi-errorfrom
mega-hindi-error-recombined
Open

aitap wants to merge 7 commits into
mega-hindi-errorfrom
mega-hindi-error-recombined

Conversation

@aitap

@aitap aitap commented Oct 17, 2026

Copy link
Copy Markdown
Member

Dear Jyoti Bhogal, Aman Singh,

In addition to the syntax fixes I pushed directly to your branch, more processing is needed for data.table to make use of the translations. I've combined the files into po/*hi.po, merged the changes to the translation templates that happened since the Hindi translation had begun, and generated the *.mo files. If you install data.table from this branch and run R with LANGUAGE=hi set (or appropriate locale settings), you will see the translated messages.

Could you please fix the translations marked "fuzzy"?

aitap added 4 commits October 17, 2026 20:50
msgcat -o ../po/R-hi.po R-*.po
rm R-*.po
msgcat -o ../po/hi.po *.po
git checkout .

(Followed by manually re-creating the msgid "" header.)
msgmerge -U R-hi.po R-data.table.pot
msgmerge -U hi.po data.table.pot

(Fixing the use of \r manually.)
msgfmt -o inst/po/hi/LC_MESSAGES/R-data.table.mo po/R-hi.po
msgfmt -o inst/po/hi/LC_MESSAGES/data.table.mo po/hi.po
@aitap
aitap requested a review from MichaelChirico as a code owner October 17, 2026 18:27
@aitap
aitap requested a review from a team October 17, 2026 18:28
@aitap

aitap commented Oct 17, 2026 •

Copy link
Copy Markdown
Member Author

tools::checkPoFiles("hi") found more problems:

./po/hi.po:620
between.c:112
too many entries, differences in entries 1,2,3
Item %d of lower (%<PRId64>) is greater than item %d of upper (%<PRId64>)
lower (%<PRId64>) का आइटम (item) %d (%<PRId64>) upper (%<PRId64>) के आइटम (item) %d (%<PRId64>) से बड़ा है।

./po/hi.po:630
between.c:137
differences in entries 1,2,3,4
Item %d of lower (%f) is greater than item %d of upper (%f)
lower (%f) का आइटम (item) %d upper (%f) के आइटम (item) %d से बड़ा है

./po/hi.po:649
between.c:187
differences in entries 1,2,3,4
Item %d of lower ('%s') is greater than item %d of upper ('%s')
lower ('%s') का आइटम (item) %d upper ('%s') के आइटम (item) %d से बड़ा है

./po/hi.po:862
dogroups.c:312
differences in entries 1,4
Supplied %d items to be assigned to group %d of size %d in column '%s'. The RHS length must either be 1 (single values are ok) or match the LHS length exactly. If you wish to 'recycle' the RHS please use rep() explicitly to make this intent clear to readers of your code.
कॉलम (column) '%s' में साइज़ %d के समूह %d को नियत (assignment) करने के लिए %d आइटम (items) दिए गए हैं। RHS की लेंथ (length) या तो 1 होनी चाहिए (सिंगल (single) मान ठीक हैं) या LHS की लेंथ (length) से बिल्कुल मेल खानी चाहिए। यदि आप RHS की पुनरावृत्ति करना चाहते हैं तो कृपया अपने कोड (code) के पाठकों को यह स्पष्ट करने के लिए स्पष्ट रूप से rep() का उपयोग करें।

./po/hi.po:991
dogroups.c:493
differences in entries 1,2
\n  collecting discontiguous groups took %.3fs for %d groups\n
\n  %d गैर-निरंतर समूहों को एकत्रित करने में %.3fs का समय लगा\n

./po/hi.po:1000
dogroups.c:494
differences in entries 1,2
\n  memcpy contiguous groups took %.3fs for %d groups\n
\n  %d निरंतर समूहों के memcpy में %.3fs का समय लगा\n

./po/hi.po:1005
dogroups.c:496
differences in entries 1,2
  eval(j) took %.3fs for %d calls\n
  eval(j) ने %d कॉल (calls) के लिए %.3fs का समय लिया\n

./po/hi.po:1593
forder.c:932 forder.c:1002 forder.c:1024 forder.c:1131 forder.c:1267 etc.
differences in entries 1,2
Failed to allocate %d bytes for '%s'.
'%s' के लिए %d बाइट्स (bytes) आवंटित करने में विफल।

./po/hi.po:1931
fread.c:1573
differences in entries 1,2
This is Windows, CreateFileMapping returned error %lu for file %s
यह Windows है, फाइल (file) %s के लिए CreateFileMapping ने एरर (error) %lu वापस किया

./po/hi.po:2333
fread.c:2186
differences in entries 2,3
  'header' determined to be true due to column %d containing a string on row 1 and a lower type (%s) in the rest of the %<PRId64> sample rows\n
  'header' को TRUE निर्धारित किया गया है क्योंकि कॉलम (column) %d की रो (row) 1 में एक स्ट्रिंग (string) है\nऔर बाकी %<PRId64> सैंपल (sample) रोज़(rows) में लोअर टाइप (lower type) (%s) है\n

./po/hi.po:2459
fread.c:2283
difference in entry 3
  Line length: mean=%.2f sd=%.2f min=%d max=%d\n
  पंक्ति की लंबाई: मीन (mean)=%.2f एसडी (sd)=%.2f न्यूनतम=%.d अधिकतम=%d\n

./po/hi.po:2517
fread.c:2383
differences in entries 1,2,3,4,5
Attempt to override column %d%s%.*s%s of inherent type '%s' down to '%s' ignored. Only overrides to a higher type are currently supported. If this was intended, please coerce to the lower type afterwards.
अंतर्निहित (inherent) प्रकार '%s' के कॉलम (column) %d%s%.*s%s को '%s' तक\nओवरराइड (override) करने के प्रयास को नजरअंदाज कर दिया गया। वर्तमान में केवल उच्च प्रकार के\nओवरराइड्स (overrides) समर्थित हैं। यदि यह जानबूझकर किया गया था, तो कृपया बाद में\nलोअर टाइप (lower type) के लिए coerce करें।

./po/hi.po:2604
fread.c:2928
differences in entries 1,2,3
Read %<PRIu64> rows x %d columns from %s file in %02d:%06.3f wall clock time\n
%s फाइल (file) से %<PRIu64> रोज़(rows) x %d कॉलम्स (columns) को %02d:%06.3f wall clock time में पढ़ा गया\n

./po/hi.po:4324
uniqlist.c:178
too few entries
Item %d of cols is %d which is outside the range [1,length(l)=%d]
cols का आइटम (item) %d है जो कि सीमा [1, length(l)=%d] के बाहर है

./po/R-hi.po:4001
test.data.table.R:209
differences in entries 1,3
Running %d of %d tests matching '%s'
'%s' से मेल खाते हुए %d में से %d परीक्षण चलाए जा रहे हैं

Any time the sequence of "conversion specifications" (e.g. %s, %d, %f, %06.3f) is different between the original message and its translation, you need to add special markers 1$, 2$, and so on after every % (even if it wasn't reordered), specifying the order in which they appear in the original, untranslated message.

For example, if the error message originally said Failed to read file %s due to error code %d on line %d and the translation says On line %d of file %s, error code %d occurred, it must be fixed to say On line %3$d of file %1$s, error code %2$d occurred.

I tried to fix the problem where the solution was obvious and marked such strings as "fuzzy" as well.

Yet another problem is making proper use of pluralisation support in gettext). I had to copy the default pluralisation string from Poedit:

Plural-Forms: nplurals=2; plural=(n==0 || n==1);

It means that when calling ngettext(n, message), msgstr[1] is chosen for n equal to 0 or 1, and msgstr[0] is chosen otherwise. Is this what you intended to happen when translating?

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant