I haven’t done translations before, however - my understanding is that…
All translations are supplied via https://www.transifex.com/discourse/discourse-org/
This at some point then is migrated into client and server files in the Discourse repo where the English versions are these:
discourse/config/locales/client.en.yml at main · discourse/discourse · GitHub
discourse/config/locales/server.en.yml at main · discourse/discourse · GitHub
This topic covers this in more detail:
This document provides a guide on how to contribute translations to the Discourse platform using Crowdin.
Required user level: Anyone can contribute translations
Translating Discourse into different languages is essential for its global adoption. Contributing as a translator or proofreader is greatly appreciated and helps in making Discourse accessible to a broader audience.
Summary
This guide covers:
Translating Discourse using Crowdin.
Becoming a proofr…
Note that there is a whole dates section in each of these files which comes from Transiflex:
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
full_no_year_no_time: "MMMM Do"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_with_year: "MMM D, YYYY h:mm a"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_with_year_no_time: "MMM D, YYYY"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
full_with_year_no_time: "MMMM Do, YYYY"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_date_with_year: "MMM D, YYYY LT"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_date_without_year: "MMM D, LT"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_date_with_year_without_time: "MMM D, YYYY"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_date_without_year_with_linebreak: "MMM D <br/>LT"
# Use Moment.js format string: https://momentjs.com/docs/#/displaying/format/
long_date_with_year_with_linebreak: "MMM D, YYYY <br/>LT"
wrap_ago: "%{date} ago"
This file has been truncated. show original
# Format directives: https://ruby-doc.org/core/Time.html#method-i-strftime
long: "%B %-d, %Y, %l:%M%P"
# Format directives: https://ruby-doc.org/core/Time.html#method-i-strftime
no_day: "%B %Y"
# Format directives: https://ruby-doc.org/core/Time.html#method-i-strftime
calendar_ics: "%Y%m%dT%H%M%SZ"
date:
# Do not remove the brackets and commas and do not translate the first month name. It should be "null".
month_names:
[
~,
January,
February,
March,
April,
May,
June,
July,
August,
September,
This file has been truncated. show original
Again hopefully someone with more knowledge will correct me if wrong…
As I see it you should submit the "jYYYY etc translations to https://www.transifex.com/discourse/discourse-org/
Moment.js will then be called with the right “jYYYY” etc instead of “YYYY”
Then you need to submit two extra code patches / Pull Requests to Discourse to add and call the extra libraries as needed:
One Pull Request to add and load moment-jalaali if, an only if “jYYYY” etc are used.
2nd Pull Request for handling any dates etc which are handled via Ruby.
Following the translation and then first pull request should get you most of the way there.
One of the Discourse team will read this at some point (they read everything here) and may comment on if this is acceptable or if they have a better idea for a way forward.
6 إعجابات