Zren / plasma-applets

This monolithic repo has been broken up into individual repos for each widget.
84 stars 23 forks source link

new translation: de #79

Closed frispete closed 7 years ago

frispete commented 7 years ago

Here's the first pass on a german translation.

The most prominent issue for a real translation: the date format isn't used for the agenda, nor the calendar.

Minor issue: "All Day", while translated, isn't picked up in agenda listing.

Zren commented 7 years ago

Thanks dude. Ah, "All Day" is translated for the future Edit Event Date/Time form, which is hidden atm. I probably need to wrap the text in i18n() in the timestamp formatting javascript.

Zren commented 7 years ago

Thanks for the translations. "All Day" is marked for translation in the hidden "Edit Event Date/Time" form I've mocked up, but I'll make the text in the agenda translated.

As for the time formats in the agenda, I'm using this bit of code to basically do __ conditions:

  1. All Day single all day event
  2. MMM d short form for a date
  3. h AP and h short form for a time on the hour
  4. h:mm AP and h:mm short form for a time where minutes isn't 0.
  5. %0, %1 date (%0) and time (%1)
  6. %0 - %1 from start date/time (%0) to end date/time (%1)

1, 2, 5, and 6 probably need translations, but 3 and 4 probably don't right? Or wait, 4 might need to translate the : so... eh, probably translated them all.

Which combined can fulfil:

x2 for 24 hour, and x2 for each start/end time not starting on the hour.

Zren commented 7 years ago

What do you think I should do for 24h clock times on the hour? Should I do 23 or 23:00? Right now it's 23 but it looks weird to me (whose is used to 12h clocks).

Zren commented 7 years ago

Gonna add a button when it notices the current session is translated, so the install process is easier.

frispete commented 7 years ago

Hi Chris,

thanks for the warmth welcome.

For german, we used to use "d MMM" and "dd.MM.yy", and as you noticed "h:mm" for time, so I think, it needs a 12h vs. 24h switch, and some selectors for such date formats (short, longer, and long forms).

In short, date formats used to have the weekday in front, day, month, then year, e.g. the long form: Mo, 10. Apr 2017.

I wouldn't translate all these date and time formats, just add more choices, and let the translator choose the preferred formats.

frispete commented 7 years ago

As for the installation process, the whole concept for plasmoid updates is half-cooked IMHO, and your stuff is lacking from this fact somewhat (in the sense of a victim).

Restarting plasmashell for new versions isn't the real McCoy either, but Qt used to have a signal for translation changes at least. I didn't checked, if it's available for Qt-Script. Being a passionate PyQt hacker, so please bear with me.

Zren commented 7 years ago

I've added:

+msgctxt "agenda date format line 1"
+msgid "MMM d"

+msgctxt "agenda date format line 2"
+msgid "ddd"

+msgid "(No title)"

since translators will probably want greater freedom in the agenda date column. Also (no title) when the event has no summary.


I don't think plasma uses qt translate (tr("string")), it uses ki18n, which wraps gettext.

This following is more for me to document my code skimming for future looking up.

My current install practice is a hack where it converts the .po files to .mo files then copies them to ~/.local/share/locale. I could probably package the .mo files and copy them without the user noticing, but it still requires a restart for them to apply. I also wasn't 100% sure if .mo files needed to be compiled for different systems (I don't think so but never confirmed it).

There's this bit of code which I think would load files from ./contents/locale, but it's been commented out for 4 years...

I'm tempted to ask wither kpackage (which only unzips to certain directories atm) should be extracting mo files too, or if they'll be uncommenting that... eventually.