Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353873 - Update usage of Locale information in HTML file names
Summary: Update usage of Locale information in HTML file names
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Yun Feng Ma CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 07:47 EDT by Will Smythe CLA
Modified: 2017-02-23 14:16 EST (History)
3 users (show)

See Also:


Attachments
adding a checkbox for controlling whether appending locale to html file (2.23 KB, application/octet-stream)
2011-08-23 01:57 EDT, Zhi Zhu CLA
no flags Details
Patch (12.03 KB, patch)
2011-08-25 06:39 EDT, Yun Feng Ma CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Will Smythe CLA 2011-08-04 07:47:41 EDT
Taken from IBM internal RTC work item 19925 ..

When deploying a RUIHandler, we always end the generated HTML file name with the locale information. We should avoid appending the locale string to the HTML file name if the user only specifies one locale? 99 times out of 100, the developer will not be building locale-aware applications. Tacking "en_US.html" is unnecessary and results in extra work for the developer to strip this off (i.e. rename the file after a deploy operation).
Comment 1 Will Smythe CLA 2011-08-04 08:35:33 EDT
This needs to be part of 0.7. I don't want the current behavior (of appending the locale) forced on new users.
Comment 2 Tony Chen CLA 2011-08-22 03:46:40 EDT
Proposed solution.

Add a checkbox at the top of the Locale section
[checkbox] Do not append locale information if there is only one locale

The status of the checkbox reflects the (opposite) value of "appendLocal" parameter  in egldd. The default value for "appendLocal" is false if this parameter is not specified. 

<?xml version="1.0" encoding="UTF-8"?>
<egl:deployment xmlns:egl="http://www.eclipse.org/xmlns/edt/deployment/1.0">
  <ruiapplication deployAllHandlers="true">
    <parameters>
      <parameter name="appendLocal" value = "false" />
      <parameter name="locales" value="en_US,English,en_US"/>
    </parameters>
  </ruiapplication>
</egl:deployment>

In deployment, check this value and the number of selected locale. If appendLocal=false and there's only one locale selected, do not append the local string to the end of the HTML filename.
Comment 3 Zhi Zhu CLA 2011-08-23 01:57:00 EDT
Created attachment 201967 [details]
adding a checkbox for controlling whether appending locale to html file
Comment 4 Will Smythe CLA 2011-08-23 07:34:15 EDT
Something feels a awkward about there being a checkbox that becomes "useless" if more than 1 locale is selected in the list. I've always wondered why we can't just be "smart" and not append the locale if only 1 is selected. As I've said before, 99% of the time developers are only targeting 1 locale anyway, so I don't think it's too big of a stretch for us to not append the locale in this case. If a developer doesn't like this behavior, they can either make a second selection OR post-process the project (like they've had to do to remove the locale in RBD and CE today).

Can we think of any reason why we shouldn't be smart and not append the locale when it's not needed (again, the vast majority of the time)?

(Tony - sorry for not responding to your proposed solution yesterday).
Comment 5 Yun Feng Ma CLA 2011-08-25 06:39:24 EDT
Created attachment 202138 [details]
Patch

This patch contains below changes:
1) rollback the changes made by Zhi.
2) Remove the locale info when only one locale is selected
Comment 6 Tony Chen CLA 2011-08-28 22:10:21 EDT
Will, I would agree to make it simple by assuming most users would just want the no-locale file. I actually thought about the two solutions (providing a flag or not) for quite a while. The only reason for a flag was trying to keep the same behavior with RBD (which I believe is the reason for many flags we have introduced). Since we are doing EDT as a new project, maybe we have to change our thinking when we deal with such issues. 
Let's go with the simple and smart way. There's no flag, the deployment logic will check the number of locales being selected, if there's only one, then no locale is append to the generated HTML.
Comment 7 Yun Feng Ma CLA 2011-08-31 02:55:19 EDT
Resolved.
Comment 8 Will Smythe CLA 2011-11-02 00:34:17 EDT
Looks good.