Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325025 - NLS not done cirrectly in JGit
Summary: NLS not done cirrectly in JGit
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 0.9.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.11   Edit
Assignee: Sasa Zivkov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-11 02:07 EDT by Robin Rosenberg CLA
Modified: 2011-01-26 12:35 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Rosenberg CLA 2010-09-11 02:07:39 EDT
A number of messages like "remote: {0}", unexpanded parameters occurs when running the JGit command line.

The reason is that the NLS bundles use the {n} syntax for parameters, but
much of the code uses PrintWriter.format for formatting which requires %1$s syntax.

Suggestion: Use MessageFormat.format for formatting and the pass the formatted string to PrintWriter.write.
Comment 1 Sasa Zivkov CLA 2011-01-26 12:29:35 EST
Hmm.. I actually found only one place where the parameter substitution wasn't done. See [1].
http://egit.eclipse.org/r/#change,2348

Additionally, the text you mentioned "remote: {0}" is defined via the
CLIText.remoteMessage and I find no issue with its usage i.e. the parameter
substitution is done at all places where it is used, for example:
AbstractFetchCommand.java:107								writer.print(MessageFormat.format(CLIText.get().remoteMessage,
						pkt));
Comment 2 Chris Aniszczyk CLA 2011-01-26 12:35:19 EST
Fixed with 990498b75d3d3955b629a48e5f39dd09bc7a3116.