Thread: [pgadmin-hackers] [pgAdmin4][Patch]: Fixed 2190 - Move language selection to Preferences.

Hi,

Please find the attached patch for #2190: Move language selection to Preferences.

Moved the user language selection into Preferences.

For the desktop mode, if the user has selected the language from the Preferences then that will be reflected otherwise English will be the default language.
For the server mode, we have given an option on the log-in page to choose the language. We drop the cookie for the selected language and also update the preferences for the same.
So, the app will be loaded with the language which the user has selected on the log-in page.
If the user will change the language from the preferences, then the cookie will be changed and also this change will be reflected on the log-in page next time.


Thanks,
Khushboo
Attachment
Hi

On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached patch for #2190: Move language selection to
> Preferences.
>
> Moved the user language selection into Preferences.
>
> For the desktop mode, if the user has selected the language from the
> Preferences then that will be reflected otherwise English will be the
> default language.
> For the server mode, we have given an option on the log-in page to choose
> the language. We drop the cookie for the selected language and also update
> the preferences for the same.
> So, the app will be loaded with the language which the user has selected on
> the log-in page.
> If the user will change the language from the preferences, then the cookie
> will be changed and also this change will be reflected on the log-in page
> next time.

I found some issues with this patch - though it's possible those
issues existed previously in some, perhaps all cases:

- The Polish translation has a bug in it that causes a syntax error in
sqleditor.js. I fixed that with:

-msgstr "Całkowity czas wykonania zapytania: %s\n"
+msgstr "Całkowity czas wykonania zapytania: %s"

- If I choose a language for the first time at login, then the
top-level menu bar isn't translated. If I completely refresh the page,
then that is resolved. We haven't loaded the main page at this point I
don't think, so I wouldn't expect to see this (though, maybe it is
being cached so we need to ensure it gets invalidated)?

- Like the top menu bar, the preferences panel doesn't seem to pickup
the new language until a hard refresh is performed. For example, the
attached screenshot is the result of me selecting Chinese at login,
having previously used Polish. Perhaps we need to add "lang=cn" or
similar to all URLs to force the cache to distinguish between
languages?

- s/misc/Misc (the preference category).

Thanks!

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Hi,

On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached patch for #2190: Move language selection to
> Preferences.
>
> Moved the user language selection into Preferences.
>
> For the desktop mode, if the user has selected the language from the
> Preferences then that will be reflected otherwise English will be the
> default language.
> For the server mode, we have given an option on the log-in page to choose
> the language. We drop the cookie for the selected language and also update
> the preferences for the same.
> So, the app will be loaded with the language which the user has selected on
> the log-in page.
> If the user will change the language from the preferences, then the cookie
> will be changed and also this change will be reflected on the log-in page
> next time.

I found some issues with this patch - though it's possible those
issues existed previously in some, perhaps all cases:

- The Polish translation has a bug in it that causes a syntax error in
sqleditor.js. I fixed that with:

-msgstr "Całkowity czas wykonania zapytania: %s\n"
+msgstr "Całkowity czas wykonania zapytania: %s"

- If I choose a language for the first time at login, then the
top-level menu bar isn't translated. If I completely refresh the page,
then that is resolved. We haven't loaded the main page at this point I
don't think, so I wouldn't expect to see this (though, maybe it is
being cached so we need to ensure it gets invalidated)?

This was my code issue which I have fixed now.
When we receive the first request (after hitting Login button), I have set that language selection into the session.
If no session then it will pick up from the cookie.
 
- Like the top menu bar, the preferences panel doesn't seem to pickup
the new language until a hard refresh is performed. For example, the
attached screenshot is the result of me selecting Chinese at login,
having previously used Polish. Perhaps we need to add "lang=cn" or
similar to all URLs to force the cache to distinguish between
languages?

In the preferences module, The aci-tree labels were not translated, that has been fixed now.
As I have introduced the session variable, so, I think we don't require to pass "lang=cn" to the URLS 
 
- s/misc/Misc (the preference category).

I have changed it to Miscellaneous. (Like pgAdmin 3) 
Thanks!

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment
Hi

On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > Please find the attached patch for #2190: Move language selection to
>> > Preferences.
>> >
>> > Moved the user language selection into Preferences.
>> >
>> > For the desktop mode, if the user has selected the language from the
>> > Preferences then that will be reflected otherwise English will be the
>> > default language.
>> > For the server mode, we have given an option on the log-in page to
>> > choose
>> > the language. We drop the cookie for the selected language and also
>> > update
>> > the preferences for the same.
>> > So, the app will be loaded with the language which the user has selected
>> > on
>> > the log-in page.
>> > If the user will change the language from the preferences, then the
>> > cookie
>> > will be changed and also this change will be reflected on the log-in
>> > page
>> > next time.
>>
>> I found some issues with this patch - though it's possible those
>> issues existed previously in some, perhaps all cases:
>>
>> - The Polish translation has a bug in it that causes a syntax error in
>> sqleditor.js. I fixed that with:
>>
>> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>> +msgstr "Całkowity czas wykonania zapytania: %s"
>>
>> - If I choose a language for the first time at login, then the
>> top-level menu bar isn't translated. If I completely refresh the page,
>> then that is resolved. We haven't loaded the main page at this point I
>> don't think, so I wouldn't expect to see this (though, maybe it is
>> being cached so we need to ensure it gets invalidated)?
>>
> This was my code issue which I have fixed now.
> When we receive the first request (after hitting Login button), I have set
> that language selection into the session.
> If no session then it will pick up from the cookie.
>
>>
>> - Like the top menu bar, the preferences panel doesn't seem to pickup
>> the new language until a hard refresh is performed. For example, the
>> attached screenshot is the result of me selecting Chinese at login,
>> having previously used Polish. Perhaps we need to add "lang=cn" or
>> similar to all URLs to force the cache to distinguish between
>> languages?
>>
> In the preferences module, The aci-tree labels were not translated, that has
> been fixed now.
> As I have introduced the session variable, so, I think we don't require to
> pass "lang=cn" to the URLS
>
>>
>> - s/misc/Misc (the preference category).
>>
> I have changed it to Miscellaneous. (Like pgAdmin 3)

That's much better. The only issues I see now are:

- The descriptive help strings in the preferences dialogue are always
shown in English

- I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
the translated version (e.g. "Pozostałe")

Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Hi,

Please find the attached updated patch.

Thanks,
Khushboo

On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > Please find the attached patch for #2190: Move language selection to
>> > Preferences.
>> >
>> > Moved the user language selection into Preferences.
>> >
>> > For the desktop mode, if the user has selected the language from the
>> > Preferences then that will be reflected otherwise English will be the
>> > default language.
>> > For the server mode, we have given an option on the log-in page to
>> > choose
>> > the language. We drop the cookie for the selected language and also
>> > update
>> > the preferences for the same.
>> > So, the app will be loaded with the language which the user has selected
>> > on
>> > the log-in page.
>> > If the user will change the language from the preferences, then the
>> > cookie
>> > will be changed and also this change will be reflected on the log-in
>> > page
>> > next time.
>>
>> I found some issues with this patch - though it's possible those
>> issues existed previously in some, perhaps all cases:
>>
>> - The Polish translation has a bug in it that causes a syntax error in
>> sqleditor.js. I fixed that with:
>>
>> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>> +msgstr "Całkowity czas wykonania zapytania: %s"
>>
>> - If I choose a language for the first time at login, then the
>> top-level menu bar isn't translated. If I completely refresh the page,
>> then that is resolved. We haven't loaded the main page at this point I
>> don't think, so I wouldn't expect to see this (though, maybe it is
>> being cached so we need to ensure it gets invalidated)?
>>
> This was my code issue which I have fixed now.
> When we receive the first request (after hitting Login button), I have set
> that language selection into the session.
> If no session then it will pick up from the cookie.
>
>>
>> - Like the top menu bar, the preferences panel doesn't seem to pickup
>> the new language until a hard refresh is performed. For example, the
>> attached screenshot is the result of me selecting Chinese at login,
>> having previously used Polish. Perhaps we need to add "lang=cn" or
>> similar to all URLs to force the cache to distinguish between
>> languages?
>>
> In the preferences module, The aci-tree labels were not translated, that has
> been fixed now.
> As I have introduced the session variable, so, I think we don't require to
> pass "lang=cn" to the URLS
>
>>
>> - s/misc/Misc (the preference category).
>>
> I have changed it to Miscellaneous. (Like pgAdmin 3)

That's much better. The only issues I see now are:

- The descriptive help strings in the preferences dialogue are always
shown in English

Fixed 
- I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
the translated version (e.g. "Pozostałe")
 
Fixed 
Thanks.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment
Hi

On Fri, Mar 17, 2017 at 12:17 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>> >> <khushboo.vashi@enterprisedb.com> wrote:
>> >> > Hi,
>> >> >
>> >> > Please find the attached patch for #2190: Move language selection to
>> >> > Preferences.
>> >> >
>> >> > Moved the user language selection into Preferences.
>> >> >
>> >> > For the desktop mode, if the user has selected the language from the
>> >> > Preferences then that will be reflected otherwise English will be the
>> >> > default language.
>> >> > For the server mode, we have given an option on the log-in page to
>> >> > choose
>> >> > the language. We drop the cookie for the selected language and also
>> >> > update
>> >> > the preferences for the same.
>> >> > So, the app will be loaded with the language which the user has
>> >> > selected
>> >> > on
>> >> > the log-in page.
>> >> > If the user will change the language from the preferences, then the
>> >> > cookie
>> >> > will be changed and also this change will be reflected on the log-in
>> >> > page
>> >> > next time.
>> >>
>> >> I found some issues with this patch - though it's possible those
>> >> issues existed previously in some, perhaps all cases:
>> >>
>> >> - The Polish translation has a bug in it that causes a syntax error in
>> >> sqleditor.js. I fixed that with:
>> >>
>> >> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>> >> +msgstr "Całkowity czas wykonania zapytania: %s"
>> >>
>> >> - If I choose a language for the first time at login, then the
>> >> top-level menu bar isn't translated. If I completely refresh the page,
>> >> then that is resolved. We haven't loaded the main page at this point I
>> >> don't think, so I wouldn't expect to see this (though, maybe it is
>> >> being cached so we need to ensure it gets invalidated)?
>> >>
>> > This was my code issue which I have fixed now.
>> > When we receive the first request (after hitting Login button), I have
>> > set
>> > that language selection into the session.
>> > If no session then it will pick up from the cookie.
>> >
>> >>
>> >> - Like the top menu bar, the preferences panel doesn't seem to pickup
>> >> the new language until a hard refresh is performed. For example, the
>> >> attached screenshot is the result of me selecting Chinese at login,
>> >> having previously used Polish. Perhaps we need to add "lang=cn" or
>> >> similar to all URLs to force the cache to distinguish between
>> >> languages?
>> >>
>> > In the preferences module, The aci-tree labels were not translated, that
>> > has
>> > been fixed now.
>> > As I have introduced the session variable, so, I think we don't require
>> > to
>> > pass "lang=cn" to the URLS
>> >
>> >>
>> >> - s/misc/Misc (the preference category).
>> >>
>> > I have changed it to Miscellaneous. (Like pgAdmin 3)
>>
>> That's much better. The only issues I see now are:
>>
>> - The descriptive help strings in the preferences dialogue are always
>> shown in English
>>
> Fixed

Nearly. I now see "None" as the help string for options that don't
actually have a string. I'm also still seeing some that aren't
translated - e.g. the binary paths options.

>> - I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
>> the translated version (e.g. "Pozostałe")
>
>
> Fixed

Yup :-)

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Hi,

Please find the attached updated patch.

Thanks,
Khushboo

On Fri, Mar 17, 2017 at 6:02 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Mar 17, 2017 at 12:17 PM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>> >> <khushboo.vashi@enterprisedb.com> wrote:
>> >> > Hi,
>> >> >
>> >> > Please find the attached patch for #2190: Move language selection to
>> >> > Preferences.
>> >> >
>> >> > Moved the user language selection into Preferences.
>> >> >
>> >> > For the desktop mode, if the user has selected the language from the
>> >> > Preferences then that will be reflected otherwise English will be the
>> >> > default language.
>> >> > For the server mode, we have given an option on the log-in page to
>> >> > choose
>> >> > the language. We drop the cookie for the selected language and also
>> >> > update
>> >> > the preferences for the same.
>> >> > So, the app will be loaded with the language which the user has
>> >> > selected
>> >> > on
>> >> > the log-in page.
>> >> > If the user will change the language from the preferences, then the
>> >> > cookie
>> >> > will be changed and also this change will be reflected on the log-in
>> >> > page
>> >> > next time.
>> >>
>> >> I found some issues with this patch - though it's possible those
>> >> issues existed previously in some, perhaps all cases:
>> >>
>> >> - The Polish translation has a bug in it that causes a syntax error in
>> >> sqleditor.js. I fixed that with:
>> >>
>> >> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>> >> +msgstr "Całkowity czas wykonania zapytania: %s"
>> >>
>> >> - If I choose a language for the first time at login, then the
>> >> top-level menu bar isn't translated. If I completely refresh the page,
>> >> then that is resolved. We haven't loaded the main page at this point I
>> >> don't think, so I wouldn't expect to see this (though, maybe it is
>> >> being cached so we need to ensure it gets invalidated)?
>> >>
>> > This was my code issue which I have fixed now.
>> > When we receive the first request (after hitting Login button), I have
>> > set
>> > that language selection into the session.
>> > If no session then it will pick up from the cookie.
>> >
>> >>
>> >> - Like the top menu bar, the preferences panel doesn't seem to pickup
>> >> the new language until a hard refresh is performed. For example, the
>> >> attached screenshot is the result of me selecting Chinese at login,
>> >> having previously used Polish. Perhaps we need to add "lang=cn" or
>> >> similar to all URLs to force the cache to distinguish between
>> >> languages?
>> >>
>> > In the preferences module, The aci-tree labels were not translated, that
>> > has
>> > been fixed now.
>> > As I have introduced the session variable, so, I think we don't require
>> > to
>> > pass "lang=cn" to the URLS
>> >
>> >>
>> >> - s/misc/Misc (the preference category).
>> >>
>> > I have changed it to Miscellaneous. (Like pgAdmin 3)
>>
>> That's much better. The only issues I see now are:
>>
>> - The descriptive help strings in the preferences dialogue are always
>> shown in English
>>
> Fixed

Nearly. I now see "None" as the help string for options that don't
actually have a string. I'm also still seeing some that aren't
translated - e.g. the binary paths options.

Fixed 
>> - I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
>> the translated version (e.g. "Pozostałe")
>
>
> Fixed

Yup :-)

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment
Thanks applied!

On Fri, Mar 24, 2017 at 9:30 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Fri, Mar 17, 2017 at 6:02 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>> On Fri, Mar 17, 2017 at 12:17 PM, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>> > Hi,
>> >
>> > Please find the attached updated patch.
>> >
>> > Thanks,
>> > Khushboo
>> >
>> > On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >>
>> >> Hi
>> >>
>> >> On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
>> >> <khushboo.vashi@enterprisedb.com> wrote:
>> >> > Hi,
>> >> >
>> >> > On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>> >> >>
>> >> >> Hi
>> >> >>
>> >> >> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>> >> >> <khushboo.vashi@enterprisedb.com> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > Please find the attached patch for #2190: Move language selection
>> >> >> > to
>> >> >> > Preferences.
>> >> >> >
>> >> >> > Moved the user language selection into Preferences.
>> >> >> >
>> >> >> > For the desktop mode, if the user has selected the language from
>> >> >> > the
>> >> >> > Preferences then that will be reflected otherwise English will be
>> >> >> > the
>> >> >> > default language.
>> >> >> > For the server mode, we have given an option on the log-in page to
>> >> >> > choose
>> >> >> > the language. We drop the cookie for the selected language and
>> >> >> > also
>> >> >> > update
>> >> >> > the preferences for the same.
>> >> >> > So, the app will be loaded with the language which the user has
>> >> >> > selected
>> >> >> > on
>> >> >> > the log-in page.
>> >> >> > If the user will change the language from the preferences, then
>> >> >> > the
>> >> >> > cookie
>> >> >> > will be changed and also this change will be reflected on the
>> >> >> > log-in
>> >> >> > page
>> >> >> > next time.
>> >> >>
>> >> >> I found some issues with this patch - though it's possible those
>> >> >> issues existed previously in some, perhaps all cases:
>> >> >>
>> >> >> - The Polish translation has a bug in it that causes a syntax error
>> >> >> in
>> >> >> sqleditor.js. I fixed that with:
>> >> >>
>> >> >> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>> >> >> +msgstr "Całkowity czas wykonania zapytania: %s"
>> >> >>
>> >> >> - If I choose a language for the first time at login, then the
>> >> >> top-level menu bar isn't translated. If I completely refresh the
>> >> >> page,
>> >> >> then that is resolved. We haven't loaded the main page at this point
>> >> >> I
>> >> >> don't think, so I wouldn't expect to see this (though, maybe it is
>> >> >> being cached so we need to ensure it gets invalidated)?
>> >> >>
>> >> > This was my code issue which I have fixed now.
>> >> > When we receive the first request (after hitting Login button), I
>> >> > have
>> >> > set
>> >> > that language selection into the session.
>> >> > If no session then it will pick up from the cookie.
>> >> >
>> >> >>
>> >> >> - Like the top menu bar, the preferences panel doesn't seem to
>> >> >> pickup
>> >> >> the new language until a hard refresh is performed. For example, the
>> >> >> attached screenshot is the result of me selecting Chinese at login,
>> >> >> having previously used Polish. Perhaps we need to add "lang=cn" or
>> >> >> similar to all URLs to force the cache to distinguish between
>> >> >> languages?
>> >> >>
>> >> > In the preferences module, The aci-tree labels were not translated,
>> >> > that
>> >> > has
>> >> > been fixed now.
>> >> > As I have introduced the session variable, so, I think we don't
>> >> > require
>> >> > to
>> >> > pass "lang=cn" to the URLS
>> >> >
>> >> >>
>> >> >> - s/misc/Misc (the preference category).
>> >> >>
>> >> > I have changed it to Miscellaneous. (Like pgAdmin 3)
>> >>
>> >> That's much better. The only issues I see now are:
>> >>
>> >> - The descriptive help strings in the preferences dialogue are always
>> >> shown in English
>> >>
>> > Fixed
>>
>> Nearly. I now see "None" as the help string for options that don't
>> actually have a string. I'm also still seeing some that aren't
>> translated - e.g. the binary paths options.
>>
> Fixed
>>
>> >> - I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
>> >> the translated version (e.g. "Pozostałe")
>> >
>> >
>> > Fixed
>>
>> Yup :-)
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>
>



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Hi Khushboo,

I suspect this may have broken
backup/restore/import/export/maintenance as I now get "Failed to load
preference pg_bin_dir of module paths" when I try to run any of them
(and this is the only patch I recall going anywhere near there
recently). If I check the Preferences dialogue, those options aren't
there at all.

Can you take a look ASAP please?

Thanks.

On Fri, Mar 24, 2017 at 10:20 AM, Dave Page <dpage@pgadmin.org> wrote:
> Thanks applied!
>
> On Fri, Mar 24, 2017 at 9:30 AM, Khushboo Vashi
> <khushboo.vashi@enterprisedb.com> wrote:
>> Hi,
>>
>> Please find the attached updated patch.
>>
>> Thanks,
>> Khushboo
>>
>> On Fri, Mar 17, 2017 at 6:02 PM, Dave Page <dpage@pgadmin.org> wrote:
>>>
>>> Hi
>>>
>>> On Fri, Mar 17, 2017 at 12:17 PM, Khushboo Vashi
>>> <khushboo.vashi@enterprisedb.com> wrote:
>>> > Hi,
>>> >
>>> > Please find the attached updated patch.
>>> >
>>> > Thanks,
>>> > Khushboo
>>> >
>>> > On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
>>> >>
>>> >> Hi
>>> >>
>>> >> On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
>>> >> <khushboo.vashi@enterprisedb.com> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>> >> >>
>>> >> >> Hi
>>> >> >>
>>> >> >> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>>> >> >> <khushboo.vashi@enterprisedb.com> wrote:
>>> >> >> > Hi,
>>> >> >> >
>>> >> >> > Please find the attached patch for #2190: Move language selection
>>> >> >> > to
>>> >> >> > Preferences.
>>> >> >> >
>>> >> >> > Moved the user language selection into Preferences.
>>> >> >> >
>>> >> >> > For the desktop mode, if the user has selected the language from
>>> >> >> > the
>>> >> >> > Preferences then that will be reflected otherwise English will be
>>> >> >> > the
>>> >> >> > default language.
>>> >> >> > For the server mode, we have given an option on the log-in page to
>>> >> >> > choose
>>> >> >> > the language. We drop the cookie for the selected language and
>>> >> >> > also
>>> >> >> > update
>>> >> >> > the preferences for the same.
>>> >> >> > So, the app will be loaded with the language which the user has
>>> >> >> > selected
>>> >> >> > on
>>> >> >> > the log-in page.
>>> >> >> > If the user will change the language from the preferences, then
>>> >> >> > the
>>> >> >> > cookie
>>> >> >> > will be changed and also this change will be reflected on the
>>> >> >> > log-in
>>> >> >> > page
>>> >> >> > next time.
>>> >> >>
>>> >> >> I found some issues with this patch - though it's possible those
>>> >> >> issues existed previously in some, perhaps all cases:
>>> >> >>
>>> >> >> - The Polish translation has a bug in it that causes a syntax error
>>> >> >> in
>>> >> >> sqleditor.js. I fixed that with:
>>> >> >>
>>> >> >> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>>> >> >> +msgstr "Całkowity czas wykonania zapytania: %s"
>>> >> >>
>>> >> >> - If I choose a language for the first time at login, then the
>>> >> >> top-level menu bar isn't translated. If I completely refresh the
>>> >> >> page,
>>> >> >> then that is resolved. We haven't loaded the main page at this point
>>> >> >> I
>>> >> >> don't think, so I wouldn't expect to see this (though, maybe it is
>>> >> >> being cached so we need to ensure it gets invalidated)?
>>> >> >>
>>> >> > This was my code issue which I have fixed now.
>>> >> > When we receive the first request (after hitting Login button), I
>>> >> > have
>>> >> > set
>>> >> > that language selection into the session.
>>> >> > If no session then it will pick up from the cookie.
>>> >> >
>>> >> >>
>>> >> >> - Like the top menu bar, the preferences panel doesn't seem to
>>> >> >> pickup
>>> >> >> the new language until a hard refresh is performed. For example, the
>>> >> >> attached screenshot is the result of me selecting Chinese at login,
>>> >> >> having previously used Polish. Perhaps we need to add "lang=cn" or
>>> >> >> similar to all URLs to force the cache to distinguish between
>>> >> >> languages?
>>> >> >>
>>> >> > In the preferences module, The aci-tree labels were not translated,
>>> >> > that
>>> >> > has
>>> >> > been fixed now.
>>> >> > As I have introduced the session variable, so, I think we don't
>>> >> > require
>>> >> > to
>>> >> > pass "lang=cn" to the URLS
>>> >> >
>>> >> >>
>>> >> >> - s/misc/Misc (the preference category).
>>> >> >>
>>> >> > I have changed it to Miscellaneous. (Like pgAdmin 3)
>>> >>
>>> >> That's much better. The only issues I see now are:
>>> >>
>>> >> - The descriptive help strings in the preferences dialogue are always
>>> >> shown in English
>>> >>
>>> > Fixed
>>>
>>> Nearly. I now see "None" as the help string for options that don't
>>> actually have a string. I'm also still seeing some that aren't
>>> translated - e.g. the binary paths options.
>>>
>> Fixed
>>>
>>> >> - I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
>>> >> the translated version (e.g. "Pozostałe")
>>> >
>>> >
>>> > Fixed
>>>
>>> Yup :-)
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][Patch]: Fixed 2190 - Move languageselection to Preferences.

From
Khushboo Vashi
Date:
Hi Dave,

I have fixed the issue and the patch for the same is attached, but the Binary path options are not translated properly.

We register the preferences before the first request of the app. In this case we don't have any language loaded, so it will take only English.
To fix this issue, I had explicitly added gettext for the labels and help messages while opening the Preference dialogue.
All the labels and help messages render properly except Binary paths; as at run time we don't get the translation of 'EDB Advanced Server Binary Path'. We have translations like below:

#: pgadmin/browser/server_groups/servers/types.py:59
msgid "{0} Binary Path"
msgstr "Ścieżka Binarna {0}"

So, in this case my suggestion is to have the entire label/help messages translations.
So, that the Preference dialogue can translate run time.



Thanks,
Khushboo

 

On Mon, Mar 27, 2017 at 6:41 AM, Dave Page <dpage@pgadmin.org> wrote:
Hi Khushboo,

I suspect this may have broken
backup/restore/import/export/maintenance as I now get "Failed to load
preference pg_bin_dir of module paths" when I try to run any of them
(and this is the only patch I recall going anywhere near there
recently). If I check the Preferences dialogue, those options aren't
there at all.

Can you take a look ASAP please?

Thanks.

On Fri, Mar 24, 2017 at 10:20 AM, Dave Page <dpage@pgadmin.org> wrote:
> Thanks applied!
>
> On Fri, Mar 24, 2017 at 9:30 AM, Khushboo Vashi
> <khushboo.vashi@enterprisedb.com> wrote:
>> Hi,
>>
>> Please find the attached updated patch.
>>
>> Thanks,
>> Khushboo
>>
>> On Fri, Mar 17, 2017 at 6:02 PM, Dave Page <dpage@pgadmin.org> wrote:
>>>
>>> Hi
>>>
>>> On Fri, Mar 17, 2017 at 12:17 PM, Khushboo Vashi
>>> <khushboo.vashi@enterprisedb.com> wrote:
>>> > Hi,
>>> >
>>> > Please find the attached updated patch.
>>> >
>>> > Thanks,
>>> > Khushboo
>>> >
>>> > On Fri, Mar 17, 2017 at 4:20 PM, Dave Page <dpage@pgadmin.org> wrote:
>>> >>
>>> >> Hi
>>> >>
>>> >> On Fri, Mar 17, 2017 at 10:25 AM, Khushboo Vashi
>>> >> <khushboo.vashi@enterprisedb.com> wrote:
>>> >> > Hi,
>>> >> >
>>> >> > On Mon, Mar 13, 2017 at 4:09 PM, Dave Page <dpage@pgadmin.org> wrote:
>>> >> >>
>>> >> >> Hi
>>> >> >>
>>> >> >> On Fri, Mar 10, 2017 at 1:55 PM, Khushboo Vashi
>>> >> >> <khushboo.vashi@enterprisedb.com> wrote:
>>> >> >> > Hi,
>>> >> >> >
>>> >> >> > Please find the attached patch for #2190: Move language selection
>>> >> >> > to
>>> >> >> > Preferences.
>>> >> >> >
>>> >> >> > Moved the user language selection into Preferences.
>>> >> >> >
>>> >> >> > For the desktop mode, if the user has selected the language from
>>> >> >> > the
>>> >> >> > Preferences then that will be reflected otherwise English will be
>>> >> >> > the
>>> >> >> > default language.
>>> >> >> > For the server mode, we have given an option on the log-in page to
>>> >> >> > choose
>>> >> >> > the language. We drop the cookie for the selected language and
>>> >> >> > also
>>> >> >> > update
>>> >> >> > the preferences for the same.
>>> >> >> > So, the app will be loaded with the language which the user has
>>> >> >> > selected
>>> >> >> > on
>>> >> >> > the log-in page.
>>> >> >> > If the user will change the language from the preferences, then
>>> >> >> > the
>>> >> >> > cookie
>>> >> >> > will be changed and also this change will be reflected on the
>>> >> >> > log-in
>>> >> >> > page
>>> >> >> > next time.
>>> >> >>
>>> >> >> I found some issues with this patch - though it's possible those
>>> >> >> issues existed previously in some, perhaps all cases:
>>> >> >>
>>> >> >> - The Polish translation has a bug in it that causes a syntax error
>>> >> >> in
>>> >> >> sqleditor.js. I fixed that with:
>>> >> >>
>>> >> >> -msgstr "Całkowity czas wykonania zapytania: %s\n"
>>> >> >> +msgstr "Całkowity czas wykonania zapytania: %s"
>>> >> >>
>>> >> >> - If I choose a language for the first time at login, then the
>>> >> >> top-level menu bar isn't translated. If I completely refresh the
>>> >> >> page,
>>> >> >> then that is resolved. We haven't loaded the main page at this point
>>> >> >> I
>>> >> >> don't think, so I wouldn't expect to see this (though, maybe it is
>>> >> >> being cached so we need to ensure it gets invalidated)?
>>> >> >>
>>> >> > This was my code issue which I have fixed now.
>>> >> > When we receive the first request (after hitting Login button), I
>>> >> > have
>>> >> > set
>>> >> > that language selection into the session.
>>> >> > If no session then it will pick up from the cookie.
>>> >> >
>>> >> >>
>>> >> >> - Like the top menu bar, the preferences panel doesn't seem to
>>> >> >> pickup
>>> >> >> the new language until a hard refresh is performed. For example, the
>>> >> >> attached screenshot is the result of me selecting Chinese at login,
>>> >> >> having previously used Polish. Perhaps we need to add "lang=cn" or
>>> >> >> similar to all URLs to force the cache to distinguish between
>>> >> >> languages?
>>> >> >>
>>> >> > In the preferences module, The aci-tree labels were not translated,
>>> >> > that
>>> >> > has
>>> >> > been fixed now.
>>> >> > As I have introduced the session variable, so, I think we don't
>>> >> > require
>>> >> > to
>>> >> > pass "lang=cn" to the URLS
>>> >> >
>>> >> >>
>>> >> >> - s/misc/Misc (the preference category).
>>> >> >>
>>> >> > I have changed it to Miscellaneous. (Like pgAdmin 3)
>>> >>
>>> >> That's much better. The only issues I see now are:
>>> >>
>>> >> - The descriptive help strings in the preferences dialogue are always
>>> >> shown in English
>>> >>
>>> > Fixed
>>>
>>> Nearly. I now see "None" as the help string for options that don't
>>> actually have a string. I'm also still seeing some that aren't
>>> translated - e.g. the binary paths options.
>>>
>> Fixed
>>>
>>> >> - I'm seeing "miscellaneous" in all languages, not "Miscellaneous" or
>>> >> the translated version (e.g. "Pozostałe")
>>> >
>>> >
>>> > Fixed
>>>
>>> Yup :-)
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>
>>
>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

Thanks!

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: [pgAdmin4][Patch]: Fixed 2190 - Move languageselection to Preferences.

From
Khushboo Vashi
Date:
Hi,

On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

The string always comes from drivers as they are being registered from there.
I have attached the patch to translate the entire string.
I took the reference of the string from the messages.po file and translated, so someone has to validate that this is the correct translation.
 
Thanks!

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment
Hi

On Friday, March 31, 2017, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

The string always comes from drivers as they are being registered from there.
I have attached the patch to translate the entire string.
I took the reference of the string from the messages.po file and translated, so someone has to validate that this is the correct translation.

All I see in the patch is updates to the message catalog. It seems to me there should be chunks in there to push the entire string back into the relevant driver, otherwise the changes to the messages.po files will be overwritten the next time I do an extract/merge. 

Essentially, I think we need to add properties to the drivers, such as:

BIN_PATH_LABEL = _("PostgreSQL Binary Path")
BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility programs (pg_dump, pg_restore etc).")

Then in types.py, we'd have something like:

            st.utility_path = paths.register(
                'bin_paths', st.stype + '_bin_dir',
                st.BIN_PATH_LABEL,
                'text', default_path, category_label=_('Binary paths'),
                help_str=st.BIN_PATH_HELP
                )
            )

Thanks.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [pgAdmin4][Patch]: Fixed 2190 - Move languageselection to Preferences.

From
Jonas Thelemann
Date:

Hey, I think this is the feature Dave meant when telling me to wait for it's completion before submitting the German translation. I already completed the German translation some weeks ago, can I submit it in the next days?

Am 01.04.2017 um 08:42 schrieb Dave Page:
Hi

On Friday, March 31, 2017, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

The string always comes from drivers as they are being registered from there.
I have attached the patch to translate the entire string.
I took the reference of the string from the messages.po file and translated, so someone has to validate that this is the correct translation.

All I see in the patch is updates to the message catalog. It seems to me there should be chunks in there to push the entire string back into the relevant driver, otherwise the changes to the messages.po files will be overwritten the next time I do an extract/merge. 

Essentially, I think we need to add properties to the drivers, such as:

BIN_PATH_LABEL = _("PostgreSQL Binary Path")
BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility programs (pg_dump, pg_restore etc).")

Then in types.py, we'd have something like:

            st.utility_path = paths.register(
                'bin_paths', st.stype + '_bin_dir',
                st.BIN_PATH_LABEL,
                'text', default_path, category_label=_('Binary paths'),
                help_str=st.BIN_PATH_HELP
                )
            )

Thanks.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


No, it's not, but the correct fix was committed a couple of days ago and I totally forgot to ping you.

Sorry about that. :-(

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK:http://www.enterprisedb.com
The Enterprise PostgreSQL Company

On 1 Apr 2017, at 15:27, Jonas Thelemann <e-mail@jonas-thelemann.de> wrote:

Hey, I think this is the feature Dave meant when telling me to wait for it's completion before submitting the German translation. I already completed the German translation some weeks ago, can I submit it in the next days?

Am 01.04.2017 um 08:42 schrieb Dave Page:
Hi

On Friday, March 31, 2017, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

The string always comes from drivers as they are being registered from there.
I have attached the patch to translate the entire string.
I took the reference of the string from the messages.po file and translated, so someone has to validate that this is the correct translation.

All I see in the patch is updates to the message catalog. It seems to me there should be chunks in there to push the entire string back into the relevant driver, otherwise the changes to the messages.po files will be overwritten the next time I do an extract/merge. 

Essentially, I think we need to add properties to the drivers, such as:

BIN_PATH_LABEL = _("PostgreSQL Binary Path")
BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility programs (pg_dump, pg_restore etc).")

Then in types.py, we'd have something like:

            st.utility_path = paths.register(
                'bin_paths', st.stype + '_bin_dir',
                st.BIN_PATH_LABEL,
                'text', default_path, category_label=_('Binary paths'),
                help_str=st.BIN_PATH_HELP
                )
            )

Thanks.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Hi,

Please find the attached updated patch.

Thanks,
Khushboo

On Sat, Apr 1, 2017 at 12:12 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi


On Friday, March 31, 2017, Khushboo Vashi <khushboo.vashi@enterprisedb.com> wrote:
Hi,

On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi Dave,
>
> I have fixed the issue and the patch for the same is attached, but the
> Binary path options are not translated properly.

Thanks - committed.

> We register the preferences before the first request of the app. In this
> case we don't have any language loaded, so it will take only English.
> To fix this issue, I had explicitly added gettext for the labels and help
> messages while opening the Preference dialogue.
> All the labels and help messages render properly except Binary paths; as at
> run time we don't get the translation of 'EDB Advanced Server Binary Path'.
> We have translations like below:
>
> #: pgadmin/browser/server_groups/servers/types.py:59
> msgid "{0} Binary Path"
> msgstr "Ścieżka Binarna {0}"
>
> So, in this case my suggestion is to have the entire label/help messages
> translations.
> So, that the Preference dialogue can translate run time.

I'm fine with that; however, the strings should come from the
underlying drivers of course, as only they should have specific
knowledge of details such as the name of the database server they
provide access to.

The string always comes from drivers as they are being registered from there.
I have attached the patch to translate the entire string.
I took the reference of the string from the messages.po file and translated, so someone has to validate that this is the correct translation.

All I see in the patch is updates to the message catalog. It seems to me there should be chunks in there to push the entire string back into the relevant driver, otherwise the changes to the messages.po files will be overwritten the next time I do an extract/merge. 

Essentially, I think we need to add properties to the drivers, such as:

BIN_PATH_LABEL = _("PostgreSQL Binary Path")
BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility programs (pg_dump, pg_restore etc).")

Then in types.py, we'd have something like:

            st.utility_path = paths.register(
                'bin_paths', st.stype + '_bin_dir',
                st.BIN_PATH_LABEL,
                'text', default_path, category_label=_('Binary paths'),
                help_str=st.BIN_PATH_HELP
                )
            )

Fixed 
Thanks.


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Attachment
Thanks, patch applied.

On Fri, Apr 14, 2017 at 4:20 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.com> wrote:
> Hi,
>
> Please find the attached updated patch.
>
> Thanks,
> Khushboo
>
> On Sat, Apr 1, 2017 at 12:12 PM, Dave Page <dpage@pgadmin.org> wrote:
>>
>> Hi
>>
>>
>> On Friday, March 31, 2017, Khushboo Vashi
>> <khushboo.vashi@enterprisedb.com> wrote:
>>>
>>> Hi,
>>>
>>> On Mon, Mar 27, 2017 at 9:57 PM, Dave Page <dpage@pgadmin.org> wrote:
>>>>
>>>> On Mon, Mar 27, 2017 at 7:49 AM, Khushboo Vashi
>>>> <khushboo.vashi@enterprisedb.com> wrote:
>>>> > Hi Dave,
>>>> >
>>>> > I have fixed the issue and the patch for the same is attached, but the
>>>> > Binary path options are not translated properly.
>>>>
>>>> Thanks - committed.
>>>>
>>>> > We register the preferences before the first request of the app. In
>>>> > this
>>>> > case we don't have any language loaded, so it will take only English.
>>>> > To fix this issue, I had explicitly added gettext for the labels and
>>>> > help
>>>> > messages while opening the Preference dialogue.
>>>> > All the labels and help messages render properly except Binary paths;
>>>> > as at
>>>> > run time we don't get the translation of 'EDB Advanced Server Binary
>>>> > Path'.
>>>> > We have translations like below:
>>>> >
>>>> > #: pgadmin/browser/server_groups/servers/types.py:59
>>>> > msgid "{0} Binary Path"
>>>> > msgstr "Ścieżka Binarna {0}"
>>>> >
>>>> > So, in this case my suggestion is to have the entire label/help
>>>> > messages
>>>> > translations.
>>>> > So, that the Preference dialogue can translate run time.
>>>>
>>>> I'm fine with that; however, the strings should come from the
>>>> underlying drivers of course, as only they should have specific
>>>> knowledge of details such as the name of the database server they
>>>> provide access to.
>>>>
>>> The string always comes from drivers as they are being registered from
>>> there.
>>> I have attached the patch to translate the entire string.
>>> I took the reference of the string from the messages.po file and
>>> translated, so someone has to validate that this is the correct translation.
>>
>>
>> All I see in the patch is updates to the message catalog. It seems to me
>> there should be chunks in there to push the entire string back into the
>> relevant driver, otherwise the changes to the messages.po files will be
>> overwritten the next time I do an extract/merge.
>>
>> Essentially, I think we need to add properties to the drivers, such as:
>>
>> BIN_PATH_LABEL = _("PostgreSQL Binary Path")
>> BIN_PATH_HELP = _("Path to the directory containing the PostgreSQL utility
>> programs (pg_dump, pg_restore etc).")
>>
>> Then in types.py, we'd have something like:
>>
>>             st.utility_path = paths.register(
>>                 'bin_paths', st.stype + '_bin_dir',
>>                 st.BIN_PATH_LABEL,
>>                 'text', default_path, category_label=_('Binary paths'),
>>                 help_str=st.BIN_PATH_HELP
>>                 )
>>             )
>>
> Fixed
>>
>> Thanks.
>>
>>
>> --
>> Dave Page
>> Blog: http://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EnterpriseDB UK: http://www.enterprisedb.com
>> The Enterprise PostgreSQL Company
>>
>



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company