zeruniverse / Password-Manager

An online keepass-like tool to manage password. client-side AES encryption!
Other
170 stars 44 forks source link

Different languages #128

Closed nickbe closed 7 years ago

nickbe commented 7 years ago

Is there a setting to change the default language? Can we translate some language file somewhere?

zeruniverse commented 7 years ago

Currently, no.

On Mon, Feb 13, 2017 at 5:54 PM Nick notifications@github.com wrote:

Is there a setting to change the default language? Can we translate some language file somewhere?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbvNLqG3MvjfMCrsJYamWOuDC_IumHDks5rcChUgaJpZM4L-_YI .

nickbe commented 7 years ago

Shall I collect all english expressions and make a first translation (english - german) file for you?

BenjaminHae commented 7 years ago

I think we should first choose a framework. Then create translation files.

nickbe commented 7 years ago

So do you want to switch completely to a framework? password-manager seems small and compact now. Otherwise why a framework for simple language specific captions?

BenjaminHae commented 7 years ago

Because a framework for languages greatly reduces effort needed for implementing different languages and increases maintainability.

nickbe commented 7 years ago

Okay. Although I don't see the point here. Don't we talk about simple language files and a simple translation routine?

zeruniverse commented 7 years ago

Actually, a framework is not necessary. We only need to translate the UI and I think there are only a few files containing UI.

On Mon, Feb 13, 2017 at 6:06 PM Benjamin Häublein notifications@github.com wrote:

Because a framework for languages greatly reduces effort needed for implementing different languages and increases maintainability.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128#issuecomment-279343220, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbvNMXQdZk4cKtf-F3ynVJ3UAfbI1Emks5rcCsegaJpZM4L-_YI .

nickbe commented 7 years ago

Ok then just say the word and I try to contribute some translations for you. (german, italian, maybe polish)

zeruniverse commented 7 years ago

But there's a problem. I think all developments will be in English. So I don't know how to sync the versions of different languages.

On Mon, Feb 13, 2017 at 6:10 PM Nick notifications@github.com wrote:

Ok then just say the word and I try to contribute some translations for you. (german, italian, maybe polish)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128#issuecomment-279344285, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbvNOKyRdcury-CuFtJqcFL2vjzj2KCks5rcCwtgaJpZM4L-_YI .

zeruniverse commented 7 years ago

Or you can create a new repo and become the maintainer of a language version. Whenever the main project receives an upgrade, you port it into your version.

For sure, I'm happy to mention your language version in the main repo.

On Mon, Feb 13, 2017 at 6:16 PM Jeffery ZHAO zzy8200@gmail.com wrote:

But there's a problem. I think all developments will be in English. So I don't know how to sync the versions of different languages.

On Mon, Feb 13, 2017 at 6:10 PM Nick notifications@github.com wrote:

Ok then just say the word and I try to contribute some translations for you. (german, italian, maybe polish)

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128#issuecomment-279344285, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbvNOKyRdcury-CuFtJqcFL2vjzj2KCks5rcCwtgaJpZM4L-_YI .

nickbe commented 7 years ago

All we need is a simple function for example lang_txt() which returns the text for the current language, and one lang..php file per language.

For Example: lang.de.php

<?php
/* 
-----------------
Language: German
-----------------
*/
$lang = array();
$lang['my website title'] = 'Meine Webseite Titel';
$lang['header title'] = 'Titel der Seite';
$lang['this is our slogan'] = 'Mein Slogan hier';
// Menu
$lang['Home'] = 'Heim';
$lang['Add password'] = 'Neues Passwort';
?>

Then all you do is replace all text output with a function call, like this echo lang_txt('Add password') ;

If the text exists in the does not exist in the language file we simply get the default english text.

BenjaminHae commented 7 years ago

I ment a framework just for internationalization. We already use jquery, bootstrap and crypto js. Using an existing framework reduces complexity and keeps the core small and maintainable. I know there are established I18n frameworks for jQuery so why not use one of them?

Furthermore: Implementing this in php breaks the separation between backend and ui. So please implement it using js. There should be tools that allow the following:

<span data-content="foo"></span>

and calling a function in javascript sets the text for every element that has a data-content attribute from a config file.

BenjaminHae commented 7 years ago

I looked around and propose using https://github.com/jquery-i18n-properties/jquery-i18n-properties It has good documentation and is mature. Implementing it should be easy but a bit of work.

zeruniverse commented 7 years ago

Great!

On Tue, Feb 14, 2017 at 8:45 PM Benjamin Häublein notifications@github.com wrote:

I looked around and propose using https://github.com/jquery-i18n-properties/jquery-i18n-properties It has good documentation and is mature. Implementing it should be easy but a bit of work.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128#issuecomment-279698014, or mute the thread https://github.com/notifications/unsubscribe-auth/AEbvNBel5OAfgpcsP2dtma6C7DAO9YDVks5rcaHsgaJpZM4L-_YI .

nickbe commented 7 years ago

Look interesting. Is the language file cached between page refreshes? (Not that it would matter with a small all like this - pure interest)

BenjaminHae commented 7 years ago

That should depend on your webserver settings.

On 14 Feb 2017 9:19 p.m., "Nick" notifications@github.com wrote:

Look interesting. Is the language file cached between page refreshes? (Not that it would matter with a small all like this - pure interest)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zeruniverse/Password-Manager/issues/128#issuecomment-279823506, or mute the thread https://github.com/notifications/unsubscribe-auth/AHCzsTkLIaKhJ4EVrGgvpMSUF4ED9xyrks5rcgw0gaJpZM4L-_YI .

zeruniverse commented 7 years ago

Any updates?