Bug 62843 - Tomcat Russian localization
Summary: Tomcat Russian localization
Status: NEW
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-22 02:14 UTC by Ivan Krasnov
Modified: 2020-01-06 16:53 UTC (History)
0 users



Attachments
Index Page Lacalisation (53.36 KB, patch)
2018-10-22 02:14 UTC, Ivan Krasnov
Details | Diff
Home Page Localisation V1.1 (34.29 KB, patch)
2018-11-06 11:49 UTC, Ivan Krasnov
Details | Diff
Home Page Localisation V1.2 (34.68 KB, patch)
2018-11-28 18:49 UTC, Ivan Krasnov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Krasnov 2018-10-22 02:14:50 UTC
Created attachment 36202 [details]
Index Page Lacalisation

Hello,
My previous patch for localization was contributed some time ago - it's bug 62558 (https://bz.apache.org/bugzilla/show_bug.cgi?id=62558).
I have completed work on the next patch. It internationalizes the homepage. I made English and Russian translations. However, other languages can be added there.
I look forward to your comments \ amendments \ wishes.I look forward to your comments \ amendments \ wishes!
Comment 1 Konstantin Kolinko 2018-10-23 09:47:17 UTC
Ivan, do you verify what the final result is (after the patch is applied)?

E.g. in the manager app "Deploy" and "Undeploy" are translated with the same word. It looks odd.
Comment 2 Ivan Krasnov 2018-11-06 11:43:25 UTC
Good day!
I created a new class and package to localize the home page. However, I was never able to achieve the creation of a new .jar file for my package during the bulding phase. The home page is crashing because of this. I solved this problem by inserting my new class into an already existing package. Now everything works fine, index page completely internationalized. 
If you are not satisfied with this way of avoiding the ".jar "problem or are not satisfied with the package in which I added my class, I will try to do it differently.
About Manager App - yes, there was a typo there, in my diff file i am correcting this mistake
Comment 3 Ivan Krasnov 2018-11-06 11:49:11 UTC
Created attachment 36246 [details]
Home Page Localisation V1.1
Comment 4 Mark Thomas 2018-11-14 21:46:28 UTC
You can't add anything in the java or javax package space as they are controlled by the specifications.

Please update the patches to the latest source code, removing the changes that have already been applied.

I think it would be better to add the l10n strings via a custom tag that looks up the provided key for the user's (not Tomcat's) locale in the resource bundle. Or similar. Unless there is something standard available that does this already. JSTL?
StringManager could provide much of the required functionality but as an internal Tomcat class it would not normally by visible to a web application.

I'll extract the Deploy/Undeploy fix and apply it.
Comment 5 Ivan Krasnov 2018-11-28 18:48:22 UTC
(In reply to Mark Thomas from comment #4)
> You can't add anything in the java or javax package space as they are
> controlled by the specifications.
> 
> Please update the patches to the latest source code, removing the changes
> that have already been applied.
> 
> I think it would be better to add the l10n strings via a custom tag that
> looks up the provided key for the user's (not Tomcat's) locale in the
> resource bundle. Or similar. Unless there is something standard available
> that does this already. JSTL?
> StringManager could provide much of the required functionality but as an
> internal Tomcat class it would not normally by visible to a web application.
> 
> I'll extract the Deploy/Undeploy fix and apply it.

Hello! I made changes and released a new diff. Now my class is not connected with java or javax package, I added it to your apache tomkat package. Is that acceptable?
Comment 6 Ivan Krasnov 2018-11-28 18:49:17 UTC
Created attachment 36283 [details]
Home Page Localisation V1.2
Comment 7 Christopher Schultz 2020-01-06 16:53:15 UTC
I just noticed that this was a (JSP) source code patch as well as a localization. The code itself is not great. It should use e.g. JSTL and use on-demand localization instead of statically-loading the strings on initialization.

The localizations are probably fine (I'd like e.g. Konstantin to validate the Russian translation); the implementation of the internationalization just needs to be done differently.

We don't currently have a dependency on JSTL. How does everyone feel about adding that as a dependency?