Translation management for SteemRandomDraw

in #utopian-io7 years ago (edited)

SteemRandomDraw is application that automate the draw.

i18next

I have added support of i18next plugin for jquery. i18next loads is needed translation so we just need to choose language. The translations stores in json files in language directory. This makes it easier to translate into other languages.
Also I have added russian language so if someone want to use this language you are welcome.
image.png

Code

It is the main code for translation management (later it was modified by @deadzy). i18next load json files from subdirectories of directory /languages. All elements in index.html with attribute 'data-i18n' have the pair key-value in translation files with the the same key as the value of attribute. The elements with class 'lang-select' call a function that changes the language to the text of element.

+       i18next
+           .use(window.i18nextXHRBackend)
+           .init({
+               lng: 'en',
+               backend: {
+                   loadPath: './locales/{{lng}}/{{ns}}.json'
+               }
+               }, function(err, t) {
+               jqueryI18next.init(i18next, $);
+               $(document).localize();
+           
+               $('.lang-select').click(function() {
+                   i18next.changeLanguage(this.innerHTML, function() {
+                   $(document).localize();
+                   });
+               });
+           });

Contact

if you have some suggestions about russian translation write it here or contact me on discord CleverShovel#7855




Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for your contribution.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Thank you for your work, it's really nice to work together

Your Post Has Been Featured on @Resteemable!
Feature any Steemit post using resteemit.com!
How It Works:
1. Take Any Steemit URL
2. Erase https://
3. Type re
Get Featured Instantly & Featured Posts are voted every 2.4hrs
Join the Curation Team Here | Vote Resteemable for Witness

Hey @clevershovel I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Utopian Witness!

Participate on Discord. Lets GROW TOGETHER!

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

I love Random Draw. Might it be possible to include "comments to comments" into the draw?