▄▄             ▄▄▄  ▄▄▄ Power
█  █ ▄▄▄▄ ▄▄▄▄▄ █  █ █  █
█▄▄█ █▄▄▄ █ █ █ █▀▀▄ █▀▀▄
█  █ ▄▄▄█ █ █ █ █▄▄▀ █▄▄▀

Login
Register
/ aa about.it ad amd64 and.who api asm asmbb asmbb.features authentication bbcode best bugs cares chat common debian deck design dll docker email embed fast feature files fossil fresh.ide friendly gamedev heap help hiawatha i18n incredible interop learning libfresh limit links linux mailing.list meme meta.http-equiv minimag money mysql neo nginx numbers orly os outage pass password post-by-email programmers programming proile read-by-email resources safety script.alert.xss secret seo skins sodom source sourcecode subdirectory subforum support tags templates test test123 type very.ugly video work xss игнат котики парола русский тест уеб.програмиране хабр.наполеон
Categories Threads

I18n ? RSS

Hello, I would like to use asmBB but I fear the engine is in english only. Is it right? How difficult would it be to translate it in my language (french) ? Do I have to translate each file manually or is there some sort of internatinalization to happend in a next version ?

My picture

macadoum

Hello, I would like to use asmBB but I fear the engine is in english only. Is it right?

How difficult would it be to translate it in my language (french) ? Do I have to translate each file manually or is there some sort of internatinalization to happend in a next version ?

Actually almost all English texts are in the templates, which are regular text files. So, you should simply translate them in order to get 90% internationalized skin.

The templates are all files with extension .tpl in the directory templates/

The remaining 10% are in the engine, in the file text_constants.asm and it is already translated to 3 languages EN, RU and BG. You can simply add one more translation. Something like: cForumSettingsTitle itext EN: "Forum settings page", \ RU: "Настройки форума", \ BG: "Настройки на форума", \ FR: "Page des paramètres du forum"

Then, change the line 112 from engine.asm: engine.asm to: stdcall SetLanguage, 'FR'

and recompile...

I know this is somehow not so easy, but when I have more translations I will make this setting accessible through the admin interface.

I made a qucick translation for the text constant file, I put this here because I know nothing about fossil and the github repo is just a mirror.

cUsersOnlineTitle itext EN: "Online Users", \ RU: "Активные потребители", \ BG: "Активни потребители", \ FR: "Utilisateurs en ligne" cPostDeleteTitle itext EN: "Delete confirmation", \ RU: "Подтверждение удаления", \ BG: "Потвърждаване на изтриване",\ FR: "Confirmer la suppression" cPostRestoreTitle itext EN: "Restore to old version", \ RU: "Восстановить предыдущую версию", \ BG: "Възстановяване до предна версия",\ FR: "Restaurer l’ancienne version" cHistoryTitle itext EN: "Post edition history", \ RU: "История редакции", \ BG: "История на редакциите", \ FR: "Historique d’édition" cForumSettingsTitle itext EN: "Forum settings page", \ RU: "Настройки форума", \ BG: "Настройки на форума", \ FR: "Paramètres du forum" cPostingInTitle itext EN: "Posting in: ", \ RU: "Написать в: ", \ BG: "Публикация в: ", \ FR: "Posté dans :" cSearchResultsTitle itext EN: "Search results for: ", \ RU: "Результаты поиска: ", \ BG: "Резултати от търсенето на: ", \ FR: "Résultats de la recherche :" cNewThreadTitle itext EN: "New thread posting", \ RU: "Новая тема", \ BG: "Нова тема", \ FR: "Poster un nouveau message" cLoginDialogTitle itext EN: "Login", \ RU: "Вход", \ BG: "Включване", \ FR: "Connexion" cUserProfileTitle itext EN: "Profile for: ", \ RU: "Профиль потребителя: ", \ BG: "Потребителски профил: " \ FR: "Profil de :" cEditingPageTitle itext EN: "Editing page: ", \ RU: "Редактирование: ", \ BG: "Редактиране на: ", \ FR: "Éditer la page:" cEditingThreadTitle itext EN: "Editing thread: ", \ RU: "Редактирование темы: ", \ BG: "Редактиране на тема: ", \ FR: "Éditer le sujet:" cSQLiteConsoleTitle itext EN: "WARNING! SQLite console. You can destroy your database here!", \ RU: "ВНИМАНИЕ! Конзоль SQLite. Возможно повреждение базы данных!", \ BG: "ВНИМАНИЕ! SQLite конзола. От тук е възможно да повредите базата данни!", \ FR: "ATTENTION ! Console SQLite. Vous pouvez détruire votre base de données !" cCreateAdminTitle itext EN: "Create the admin account!", \ RU: "Создание учетную запись администратора!", \ BG: "Създаване на потребител администратор!", \ FR: "Créer le compte administrateur !" cThreadListTitle itext EN: "Threads list ", \ RU: "Темы ", \ BG: "Теми ", \ FR: "Liste des sujets" cChatTitle itext EN: "Chat ", \ RU: "Чат ", \ BG: "Чат ", \ FR: "Tchat" cAnonName itext EN: "Anon", \ RU: "Анон", \ BG: "Анон", \ FR: "Anon" cEmptySearch itext EN: "The search found nothing. Try another keywords.", \ RU: "Поиск не нашел ничего. Попробуйте другой запрос.", \ BG: "Търсенето не намери нищо. Опитайте с други думи.", \ FR: "La recherche n’a rien renvoyer. Essayer d’autres mots-clés."

As I undestand the template traduction, I need to translate the wasp directory, no matter I want to use the Light template, right ? As a quick exemple, I translated the thread_info.tpl file :

<div class="thread_summary"> <div class="thread_info"> <div class="flex"> [case:[Pinned]||<img class="pinned" src="[special:skin]/_images/pinned.png" alt="!" title="Sujet épinglé">] [case:[limited]||<img height="32" width="32" class="unread" src="[special:skin]/_images/limited.svg" alt="#" title="Sujet à accès limité">] [case:[Unread]||<a href="[FirstUnread]/!by_id">] <img height="32" width="32" class="unread" src="[special:skin]/_images/posts[case:[Unread]|_gray|].svg" alt="[case:[Unread]||&gt;]" title="[case:[Unread]|Pas de messages non lu|Aller au prmier non lu]">[case:[Unread]||</a>] [PostCount] [case:[PostCount]|posts|post|posts] </div> [case:[Unread]||<div class="unread_cnt">( [Unread] unread ) <a href="[Slug]/!markread" title="Mark thread read"><img width="16" height="16" src="[special:skin]/_images/markread.svg" alt="X"></a></div>] <div class="unread_cnt">[ReadCount] [case:[ReadCount]|views|view|views]</div> <div class="changed">[TimeChanged]</div> </div> <div class="thread_right"> <div class="thread_link"> <a class="thread_link" href="[Slug]/">[Caption]</a><br> <label><input type="checkbox" class="collapseit"><ul class="small comma posters">[html:[Posters]]</ul></label> <label><input type="checkbox" class="collapseit"><ul class="small comma invited">[html:[Invited]]</ul></label> </div> <ul class="small comma thread_tags">[html:[ThreadTags]]</ul> </div> </div>

Is it rightly translated, no forgotten strings ? If yes, it will be really quick to translate the whole template. :-)

Edit : add files as attachements because of the code block

Attached files:
FileSizeUploadedDownloadsMD5 hash
Sans nom 3.odt14083 bytes11.02.201917c24f98d793b71d696554e6bcc892c14f
Sans nom 2.odt17825 bytes11.02.2019216b671dd4961b89ec8a90c67159ac7723

The trick with the files in the different skins is that most of the template files are not changed amongs the different skins. This way, the file is defined in the directory wasp/, but there are symlinks in all the other skin directories.

This way, translating a file in the directory templates/wasp/ you are translating it in all other skins as well.

But notice, that there are files in the remaining skins that are not symlinks and they need to be translated individually as well. Though, all these files will contain the same text (or almost the same), but different markup.

Simply attach your translations here and I will submit them to the repository, or maybe will create different repository for the translations. Or even separate the project in two - templates and the engine... well, I am not sure right now... :-)

OK, now AsmBB has a "true" internationalization of the user interface. It is based on the user preferences, so every user can choose the UI language.

The translation is based on the rendering engine, so it loads the backend a little, but I hope the engine will be anyway fast enough.

Of course, the whole skins are still not fully translated. I will make some effort to finish the Bulgarian and Russian translations and will wait for volunteers to finish the french translation.

The idea of the translation is demonstrated in the following template example (a part of the file main_html_end.tpl):

<div class="footer"> <p>[case:[special:lang]| <a href="/!users_online" title="Recent activities of the visitors.">Online</a> now: [special:visitors] | <a href="/!users_online" title="Последни действия на посетителите.">Онлайн</a> в момента: [special:visitors] | <a href="/!users_online" title="Последние действия потребителей.">Сейчас</a> в сети: [special:visitors] | <a href="/!users_online" title="Activités récentes des visiteurs.">En ligne</a> maintenant: [special:visitors] ] </p> <br> [special:stats] <br> <p>[case:[special:lang]|Page processing time|Време за обработка на страницата|Время обработки страницы|Temps de traitement de la page]: [special:timestamp] ms</p> </div>

It is based on the [special:lang] special parameter and [case] template operator. [special:lang] returns a number according to the language selected by the user. The values are:

Values of [special:lang] parameter: 0: English 1: Bulgarian 2: Russian 3: French

P.S. In the above example, the French phrases are translated with google, so can be incorrect.

So if I understand well, this must be done for every file to get a fully translated interface ?

I mean each file will get it's own

<p>[case:[special:lang]| <a href=".... <a href=".... <a href=".... <a href=".... </div>

Right ?

johnfound

will wait for volunteers to finish the french translation.

This is now done by 80%

macadoum

So if I understand well, this must be done for every file to get a fully translated interface ?

I mean each file will get it's own

<p>[case:[special:lang]| <a href=".... <a href=".... <a href=".... <a href=".... </div>

Right ?

Generally speaking yes. But it needs also | character as a separator. The template operator [case:] has the following syntax:

[case:NUMBER|TEXT_FOR_0|TEXT_FOR_1|...|TEXT_FOR_N_AND_ABOVE]

It leaves in the output text only the text that corresponds with the value of the NUMBER. The operator [special:lang] returns the number of the language for the particular user.

Using this construction, several variants of use are possible. In the my example, there are two of them. The first includes into the case text list, the whole text together with the HTML markup. This variant is suitable when there is little markup and more text in the translated block. The drawback is that if the markup need to be edited later, there are several copies of this markup that need to be kept in sync.

The other variant is to translate only the text without the markup, like in the following example:

<p>[case:[special:lang]|Page processing time|Време за обработка на страницата|Время обработки страницы|Temps de traitement de la page]: [special:timestamp] ms</p>

This way, the HTML markup is only in one copy and synchronization on edits is not needed. But in many cases, this approach need more [case:] operators, this way making template slower for rendering and lowering the performance of the engine.

So, as always it is a matter of tradeoff and personal style preferences. :-)

Anyway, all this is not so important. The content is important. I always can help on the particular formatting.

I finished the translation of the wasp template. I don't know how you want to integrate my translation into your i18n system.

I send it through an attached file.

I'm not sure it can help you in its actual form. Please ask if you need anything more.;-)

Attached files:
FileSizeUploadedDownloadsMD5 hash
WaspFr.7z24915 bytes16.02.20192253a5a8667d553355bc1a7f2d8e154cc9

Great, thanks! :-)

I will integrate it into the whole system and will publish it in a several days as an official release. Will ask in this thread if something is not clear.

Categories Threads

I18n ? RSS

AsmBB v2.5 (check-in: d3a7fac8228a901e); SQLite v3.27.2 (check-in: bd49a8271d650fa8);

©2016..2018 John Found; Licensed under EUPL.
Powered by Assembly language
Created with Fresh IDE

Icons are made by Egor Rumyantsev, vaadin and icomoon from www.flaticon.com