lvgl / lv_i18n

Internationalization (i18n) for LVGL
MIT License
57 stars 17 forks source link

other: %d users are logged in - reason: 'bad indentation of a mapping entry', #44

Closed Coffeeye closed 2 years ago

Coffeeye commented 2 years ago

Iam trying to use your example but running convert gives me error (bcs of "%d")

  reason: 'bad indentation of a mapping entry',
  mark: Mark {
    name: '../../main/display/translations/en-GB.yml',
    buffer: "'en-GB':\r\n" +
      '  title1: Main menu\r\n' +
      '  user_logged_in:\r\n' +
      '    one: One user is logged in\r\n' +
      '    other: %d users are logged in\n' +
      '\x00',
    position: 93,
    line: 4,
    column: 11
  }
}
puzrin commented 2 years ago

Thanks for info. Fixed.

http://nodeca.github.io/js-yaml/#yaml=b3RoZXI6ICclZCB1c2VycyBhcmUgbG9nZ2VkIGluJw==

Some strings with special chars should be quoted. Use online demo to ensure result is as you expect.

Coffeeye commented 2 years ago

Cause another error see FIX

puzrin commented 2 years ago

That's not error. It returns proper plural form of string, and then you can post-process it as you need.

https://github.com/lvgl/lv_i18n#mark-up-the-text-in-your-code see the end of example, where sprintf used.