AsmBB

Power
Login Register

I18n ?
0

0 1
#15746 (ツ) macadoum
Created 10.02.2019, read: 9532 times

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

#15747 (ツ) johnfound
Last edited: 11.02.2019 by johnfound, read: 9518 times
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.

#15748 (ツ) macadoum
Last edited: 11.02.2019 by macadoum, read: 9497 times

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.2019674c24f98d793b71d696554e6bcc892c14f
Sans nom 2.odt17825 bytes11.02.20199666b671dd4961b89ec8a90c67159ac7723
#15749 (ツ) johnfound
Created 11.02.2019, read: 9494 times

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... :-)

#15761 (ツ) johnfound
Created 15.02.2019, read: 9456 times

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.

#15762 (ツ) macadoum
Last edited: 15.02.2019 by macadoum, read: 9450 times

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 ?

#15763 (ツ) macadoum
Last edited: 15.02.2019 by macadoum, read: 9450 times
johnfound

will wait for volunteers to finish the french translation.

This is now done by 80%

#15764 (ツ) johnfound
Created 15.02.2019, read: 9447 times
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.

#15765 (ツ) macadoum
Last edited: 17.02.2019 by macadoum, read: 9435 times

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.201941253a5a8667d553355bc1a7f2d8e154cc9
#15766 (ツ) johnfound
Created 17.02.2019, read: 9432 times

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.

#15871 (ツ) mlmsoftwareindia
Last edited: 18.05.2019 by johnfound, read: 9079 times

SEO spam deleted.

The administration

#15880 (ツ) macadoum
Last edited: 04.06.2019 by macadoum, read: 8963 times

Hello johnfound, as I said here, I update the French translation. I just send the files attached as a zip.

But there is some strings I cannot translate, here in red :

My picture My picture

I check for others languages and these strings aren't translated too because it's actually not possible.

Another problem is that the theme selector upper right is actually broken and doesn't change anything if using a different language than english.

I hope these problems can be fix.

Attached files:
FileSizeUploadedDownloadsMD5 hash
tpl.zip17469 bytes04.06.2019647363e9fd0c5ac533340bd785f055c0a94
#15881 (ツ) johnfound
Created 04.06.2019, read: 8954 times

@macadoum: Thanks for the report. I will try to fix it ASAP - probably in 1..2 days.

macadoum

Another problem is that the theme selector upper right is actually broken and doesn't change anything if using a different language than english.

But I can't reproduce the quoted problem. I am using the Bulgarian translation of the forum and the fast theme selector is working OK for me... Or I am doing something wrong?

#15882 (ツ) KyberMax
Created 04.06.2019, read: 8948 times
johnfound
macadoum

Another problem is that the theme selector upper right is actually broken and doesn't change anything if using a different language than english.

But I can't reproduce the quoted problem. I am using the Bulgarian translation of the forum and the fast theme selector is working OK for me... Or I am doing something wrong?

On my computer, the forum has switched to Bulgarian, switching themes works. How to put another language I did not find.

#15884 (ツ) johnfound
Created 05.06.2019, read: 8939 times
KyberMax

On my computer, the forum has switched to Bulgarian, switching themes works. How to put another language I did not find.

Oh, sorry! By mistake I switched the default forum language to Bulgarian. But you still can select different language from your user profile.

#15887 (ツ) KyberMax
Created 05.06.2019, read: 8933 times
johnfound

...you still can select different language from your user profile.

It works. But why the theme can be selected on the forum page and in the profile, and the language only in the profile? Imho this is inconvenient.

#15888 (ツ) johnfound
Created 05.06.2019, read: 8932 times
KyberMax
johnfound

...you still can select different language from your user profile.

It works. But why the theme can be selected on the forum page and in the profile, and the language only in the profile? Imho this is inconvenient.

The fast theme selector differs a little from the theme selector in your profile and from the default theme selector in the forum settings.

The fast theme selector on the top of the page works with session cookie and if you close the browser and open the forum again, this setting will be reset to default. This mechanism was created solely for use from the unregistered guests, because they simply have no profile.

The profile theme setting simply overrides the forum default setting. But it also forces the forum to a single theme, while if set to "default" it will change the theme with the mobile theme if browsing from a mobile device.

The forum default theme setting is actually two settings: one theme for the PC browsers and one theme for the mobile phone browsers.

The whole design is planned in a way to softly press the users to use the administration preferred themes, while still allowing override if the user hardly dislike the official choice.

The interface language setting, on the other hand, has no need to be so flexible. Usually, the interface language is the same as the language the forum users write their posts. Multi-language forums (like this demo forum) are actually very, very rare.

#15889 (ツ) KyberMax
Created 06.06.2019, read: 8919 times
johnfound

The fast theme selector on the top of the page works with session cookie and if you close the browser and open the forum again, this setting will be reset to default.

Yes, if only session cookies are deleted after each session. If the browser is not configured to do this, then the settings are saved in the next session.

johnfound

The interface language setting, on the other hand, has no need to be so flexible. Usually, the interface language is the same as the language the forum users write their posts. Multi-language forums (like this demo forum) are actually very, very rare.

In fact, multilingual sites usually determine the language of the user by the IP address, but additionally provide the ability for the user to set the language manually. Imho this option should be on any page of this forum, because it is not only multilingual, but also a demo, so it is simply necessary at least to check the correctness of language support.

#15890 (ツ) johnfound
Created 06.06.2019, read: 8917 times
KyberMax

Yes, if only session cookies are deleted after each session. If the browser is not configured to do this, then the settings are saved in the next session.

The session cookies are always deleted after the end of the session. You can configure the browser to delete the persistent cookies after the session, but this is totally different story.

AsmBB uses persistent cookies only for the login and only if you check the "Persistent login" checkbox. Else it uses session cookie that is deleted after the browser closed.

#15891 (ツ) KyberMax
Last edited: 08.06.2019 by KyberMax, read: 8900 times
johnfound

The session cookies are always deleted after the end of the session. You can configure the browser to delete the persistent cookies after the session, but this is totally different story.

Yes, and there is some illogicality here because of the definition of "session." Most likely it appeared when browsers did not have tabs and the session lasts until the browser is closed. Although it would be more logical to end the session with the site when you close all the tabs of this site.

I see on the forum appeared automatically determine the user's language. Through IP probably?

By the way, here is the first result: instead of "потребитель" it is more correct to use "пользователь". Or even "участник форума".

0 1

I18n ?
0

AsmBB v3.0 (check-in: a316dab8b98d07d9); SQLite v3.42.0 (check-in: 831d0fb2836b71c9);
©2016..2023 John Found; Licensed under EUPL. Powered by Assembly language Created with Fresh IDE