message.km 707 B

12345678910111213141516171819202122232425
  1. function msg-factory:
  2. &(l10n::Locale) => &(Number) => String
  3. &(locale) => &(n) =>
  4. let {language} := locale,
  5. if (language = 'zh_TW'):
  6. { "收到 ? 筆資料" { String n } },
  7. elif (language = 'zh_CN'):
  8. { "收到 ? 条数据" { String n } },
  9. else:
  10. if (n = 1):
  11. 'one item received',
  12. else:
  13. { "? items received" { String n } };
  14. const locale: l10n::Locale :=
  15. os::Locale;
  16. do
  17. let make-msg := { msg-factory locale },
  18. { os::println {
  19. "message 0: ?"..\n.. "message 1: ?"..\n.. "message 2: ?"
  20. ({make-msg 0}, {make-msg 1}, {make-msg 2})
  21. } }
  22. . { crash-on-error };