Template for page numbers or other "X of Y' usage

10 views
Skip to first unread message

Doug Ewell

unread,
Apr 14, 2023, 5:18:39 PM4/14/23
to cldr-...@unicode.org
Does CLDR have a template for a construction like “Page 1 of 10”? I could not find anything like this. I did find the date format items for “week of month” and “week of year,” but this isn’t quite the same.

I’m trying to build the argument that creating separate string resources for “page” and “of”, and hard-coding the relationship between the strings and the numbers, is a bad idea.

--
Doug Ewell, CC, ALB | Lakewood, CO, US | ewellic.org

Steven R. Loomis

unread,
Apr 14, 2023, 5:22:36 PM4/14/23
to Doug Ewell, cldr-...@unicode.org
No.

There are some typography related translation terms, such as translation for various font weights and other terms.

I could see this maybe possibly eventually generally in scope as commonly used… but would need sample data ,a spec, maintenance, etc…

You could start with a public page somewhere trying to collect the translations.  That might help answer your question

hope it helps,
--
Steven R. Loomis
Code Hive Tx, LLC



--
You received this message because you are subscribed to the Google Groups "CLDR Users Public Mail List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cldr-users+...@unicode.org.
To view this discussion on the web visit https://groups.google.com/a/unicode.org/d/msgid/cldr-users/SJ0PR03MB6598C6EB11ED6EB454C61761CA999%40SJ0PR03MB6598.namprd03.prod.outlook.com.

Tom Moore

unread,
Apr 14, 2023, 5:36:02 PM4/14/23
to Steven Loomis, Doug Ewell, cldr-...@unicode.org

For my 2 cents:  Create a *single* localizable string resource “Page {0} of {1}”.

 

Sent from Mail for Windows

Doug Ewell

unread,
Apr 14, 2023, 6:18:13 PM4/14/23
to Tom Moore, Steven Loomis, cldr-...@unicode.org
Tom Moore wrote:

> For my 2 cents: Create a *single* localizable string resource
> “Page {0} of {1}”.

Well, yes, of course that’s the best approach, if CLDR doesn’t have such a resource or if you’re not using CLDR.

Unfortunately, someone in my organization implemented the bad solution with separate “Page” and “of” resources, and probably looked (if anywhere) at familiar examples from Western European languages such as “Página 1 de 10” and “Seite 1 von 10” for reinforcement that it would work universally.

I was looking for counterexamples that some languages invert the order of the 1 and the 10, or at least have additional text following the 10, as often seen with long date formats. I was reluctant to just start running “Page 1 of 10” through Google Translate, unsure whether I could trust GT to understand the idiom. I figured a better approach would be to check whether CLDR already had such a resource, and if so, find my counterexample(s) in the localized CLDR data.

Steven R. Loomis

unread,
Apr 14, 2023, 6:27:58 PM4/14/23
to Doug Ewell, Tom Moore, cldr-...@unicode.org

https://github.com/planswell/surveyjs/blob/23410e8b83471023db1fa0b167d1b2e5d02eaa37/src/localization/arabic.ts#L7


seems to have {1} before {0} in the Arabic (progressText) but perhaps that’s due to the context somehow…

progressText: "{1} صفحة {0} من",


--
Steven R. Loomis
Code Hive Tx, LLC
https://codehivetx.us



Mark Davis Ⓤ

unread,
Apr 14, 2023, 7:27:16 PM4/14/23
to Steven R. Loomis, Doug Ewell, Tom Moore, CLDR Users Public Mail List
Haven't seen anything like that, but I can well imagine that a language might use ordinals or cardinals, which would require a select message so it could pick among them. Eg.

One: {0}st page of {1}
Two: {0}nd page of {2}
...



--
You received this message because you are subscribed to the Google Groups "CLDR Users Public Mail List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cldr-users+...@unicode.org.

Martin J. Dürst

unread,
Apr 15, 2023, 10:06:04 PM4/15/23
to Doug Ewell, Tom Moore, Steven Loomis, cldr-...@unicode.org
Hello Doug, others,

I agree that just relying on some automatic translation software isn't a
good idea. But it may give some hints. And when it comes to
internationalization/localization, or in a wider setting, linguistics in
general, the overarching principle is that there are always exceptions.

Anyway, looking at the Chinese google translation, I get
"第 1 页,共 10 页" (word-by-word backwards translation: Number 1 page,
together 10 page). Here we already have some text after "10". The
translation 'feels' very Chinese to me, but I have never learned any
Chinese.

The Japanese google translation is also interesting (and supported by my
Japanese knowledge): "1/10 ページ". Again, text at the end. But what's more
interesting is something that's not visible here, namely that when
reading this, the 10 comes before the 1. This is because 1/10 is read
essentially like a fraction, and fractions are read "reversed" in
Japanese, so "three fifths" is read as "三分の五", i.e. "(out of) five
parts, three". If "1/10 ページ" is read out, it may be read "1分の10ページ"
(literally, "one tenth page"), or expanded maybe something like
"10ページのうち1ページ目" ("out of 10 pages, the first page").

So in Japanese, the order of the numbers may depend on whether a short
or a longer version is used (the shortest would be just 1/10, in a
corner of some printout where it's clear that this refers to pages, the
same way it's done in English), and whether it's written or spoken.

Regards, Martin.

Joan Montané

unread,
Apr 16, 2023, 10:15:19 AM4/16/23
to Martin J. Dürst, Doug Ewell, Tom Moore, Steven Loomis, cldr-...@unicode.org
Hi, all

> > Unfortunately, someone in my organization implemented the bad solution with separate “Page” and “of” resources, and probably looked (if anywhere) at familiar examples from Western European languages such as “Página 1 de 10” and “Seite 1 von 10” for reinforcement that it would work universally.
> >
> > I was looking for counterexamples that some languages invert the order of the 1 and the 10, or at least have additional text following the 10, as often seen with long date formats. I was reluctant to just start running “Page 1 of 10” through Google Translate, unsure whether I could trust GT to understand the idiom. I figured a better approach would be to check whether CLDR already had such a resource, and if so, find my counterexample(s) in the localized CLDR data.

You can check LibreOffice translation project for several languages.
According to [1], "Page %1 of %2" is translated as "%2 ನಲ್ಲಿನ %1 ಪುಟ"
in Kannada language, and "Адаҟьа %1 %2 аҟынтәи" in Abkhaz language.

My 2 cents.

Joan Montané

[1] https://translations.documentfoundation.org/search/libo_ui-master/?offset=1&q=+source%3A%3D%22Page+%251+of+%252%22+&sort_by=-priority%2Cposition&checksum=

Mark Davis Ⓤ

unread,
Apr 16, 2023, 12:38:03 PM4/16/23
to Joan Montané, Martin J. Dürst, Doug Ewell, Tom Moore, Steven Loomis, cldr-...@unicode.org
Simple rearranging of the placeholders and changing the literals around them is no problem for any good message formatter (such as ICU's), and most translation software is set up to deal with that. Whether the pattern is "xxx{0}yyy{1}zzz" or "aaa{1}bbb{0}ccc" (where the xxx, etc can be any or no string) doesn't make a difference. The key is to have the whole phrase translated as a single message, and not try to concatenate pieces.

What would make it slightly more challenging is if some languages had grammatical changes depending on the numbers. Again, not a huge problem; but the system would need to be set up to handle "select" messages.

--
You received this message because you are subscribed to the Google Groups "CLDR Users Public Mail List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cldr-users+...@unicode.org.

r12a

unread,
Apr 17, 2023, 6:12:02 AM4/17/23
to Doug Ewell, Joan Montané, Martin J. Dürst, Tom Moore, Steven Loomis, cldr-...@unicode.org, Mark Davis Ⓤ
The principles involved extend well beyond page numbering.  Fwiw, see this article https://www.w3.org/International/articles/composite-messages/

ri
Reply all
Reply to author
Forward
0 new messages