____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

Translation management for SteemRandomDraw

BY: @clevershovel | CREATED: April 8, 2018, 12:25 p.m. | VOTES: 62 | PAYOUT: $98.03 | [ VOTE ]

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: https://cdn.utopian.io/posts/52c31227d1105f49a55f40f1def2e4a2fe9dimage.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

TAGS: [ #utopian-io ] [ #apps ] [ #steemdev ] [ #dev ]

Replies

@deadzy | April 8, 2018, 3:38 p.m. | Votes: 0 | [ VOTE ]

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

@clevershovel | April 8, 2018, 4:36 p.m. | Votes: 0 | [ VOTE ]

Me too :)

@resteemable | April 8, 2018, 7:18 p.m. | Votes: 0 | [ VOTE ]

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

@codingdefined | April 11, 2018, 4:40 a.m. | Votes: 1 | [ VOTE ]

Thank you for your contribution.

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

[utopian-moderator]

@utopian-io | April 11, 2018, 12:13 p.m. | Votes: 0 | [ VOTE ]

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!
- Vote for my Witness
- Proxy vote to Utopian Witness

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

@muscara | Nov. 6, 2018, 9:37 p.m. | Votes: 0 | [ VOTE ]

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

[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>