View Javadoc
1   /*
2    * Copyright (C) 2010, 2013 Sasa Zivkov <sasa.zivkov@sap.com>
3    * Copyright (C) 2013, Obeo
4    * and other copyright owners as documented in the project's IP log.
5    *
6    * This program and the accompanying materials are made available
7    * under the terms of the Eclipse Distribution License v1.0 which
8    * accompanies this distribution, is reproduced below, and is
9    * available at http://www.eclipse.org/org/documents/edl-v10.php
10   *
11   * All rights reserved.
12   *
13   * Redistribution and use in source and binary forms, with or
14   * without modification, are permitted provided that the following
15   * conditions are met:
16   *
17   * - Redistributions of source code must retain the above copyright
18   *   notice, this list of conditions and the following disclaimer.
19   *
20   * - Redistributions in binary form must reproduce the above
21   *   copyright notice, this list of conditions and the following
22   *   disclaimer in the documentation and/or other materials provided
23   *   with the distribution.
24   *
25   * - Neither the name of the Eclipse Foundation, Inc. nor the
26   *   names of its contributors may be used to endorse or promote
27   *   products derived from this software without specific prior
28   *   written permission.
29   *
30   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
31   * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
32   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
33   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
35   * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
37   * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
41   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
42   * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43   */
44  
45  package org.eclipse.jgit.pgm.internal;
46  
47  import java.text.MessageFormat;
48  import java.util.Locale;
49  
50  import org.eclipse.jgit.nls.NLS;
51  import org.eclipse.jgit.nls.TranslationBundle;
52  import org.kohsuke.args4j.Localizable;
53  
54  /**
55   * Translation bundle for JGit command line interface
56   */
57  public class CLIText extends TranslationBundle {
58  	/**
59  	 * Formats text strings using {@code Localizable}.
60  	 *
61  	 */
62  	public static class Format implements Localizable {
63  		final String text;
64  
65  		Format(String text) {
66  			this.text = text;
67  		}
68  
69  		@Override
70  		public String formatWithLocale(Locale locale, Object... args) {
71  			// we don't care about Locale for now
72  			return format(args);
73  		}
74  
75  		@Override
76  		public String format(Object... args) {
77  			return MessageFormat.format(text, args);
78  		}
79  	}
80  
81  	/**
82  	 * @param text
83  	 *            the text to format.
84  	 * @return a new Format instance.
85  	 */
86  	public static Format format(String text) {
87  		return new Format(text);
88  	}
89  
90  	/**
91  	 * @return an instance of this translation bundle
92  	 */
93  	public static CLIText get() {
94  		return NLS.getBundleFor(CLIText.class);
95  	}
96  
97  	/**
98  	 * Format the given line for using the format defined by {@link #lineFormat}
99  	 * ("# " by default).
100 	 *
101 	 * @param line
102 	 *            the line to format
103 	 * @return the formatted line
104 	 */
105 	public static String formatLine(String line) {
106 		return MessageFormat.format(get().lineFormat, line);
107 	}
108 
109 	/**
110 	 * Format the given argument as fatal error using the format defined by
111 	 * {@link #fatalError} ("fatal: " by default).
112 	 *
113 	 * @param message
114 	 *            the message to format
115 	 * @return the formatted line
116 	 */
117 	public static String fatalError(String message) {
118 		return MessageFormat.format(get().fatalError, message);
119 	}
120 
121 	// @formatter:off
122 	/***/ public String alreadyOnBranch;
123 	/***/ public String alreadyUpToDate;
124 	/***/ public String answerNo;
125 	/***/ public String answerYes;
126 	/***/ public String authorInfo;
127 	/***/ public String averageMSPerRead;
128 	/***/ public String branchAlreadyExists;
129 	/***/ public String branchCreatedFrom;
130 	/***/ public String branchDetachedHEAD;
131 	/***/ public String branchIsNotAnAncestorOfYourCurrentHEAD;
132 	/***/ public String branchNameRequired;
133 	/***/ public String branchNotFound;
134 	/***/ public String cacheTreePathInfo;
135 	/***/ public String configFileNotFound;
136 	/***/ public String cannotBeRenamed;
137 	/***/ public String cannotChekoutNoHeadsAdvertisedByRemote;
138 	/***/ public String cannotCombineSquashWithNoff;
139 	/***/ public String cannotCreateCommand;
140 	/***/ public String cannotCreateOutputStream;
141 	/***/ public String cannotDeatchHEAD;
142 	/***/ public String cannotDeleteFile;
143 	/***/ public String cannotDeleteTheBranchWhichYouAreCurrentlyOn;
144 	/***/ public String cannotGuessLocalNameFrom;
145 	/***/ public String cannotLock;
146 	/***/ public String cannotMergeDetachedHead;
147 	/***/ public String cannotReadBecause;
148 	/***/ public String cannotReadPackageInformation;
149 	/***/ public String cannotRenameDetachedHEAD;
150 	/***/ public String cannotResolve;
151 	/***/ public String cannotSetupConsole;
152 	/***/ public String cannotUseObjectsWithGlog;
153 	/***/ public String cantFindGitDirectory;
154 	/***/ public String cantWrite;
155 	/***/ public String changesNotStagedForCommit;
156 	/***/ public String changesToBeCommitted;
157 	/***/ public String checkingOut;
158 	/***/ public String checkoutConflict;
159 	/***/ public String checkoutConflictPathLine;
160 	/***/ public String cleanRequireForce;
161 	/***/ public String clonedEmptyRepository;
162 	/***/ public String cloningInto;
163 	/***/ public String commitLabel;
164 	/***/ public String conflictingUsageOf_git_dir_andArguments;
165 	/***/ public String couldNotCreateBranch;
166 	/***/ public String dateInfo;
167 	/***/ public String deletedBranch;
168 	/***/ public String deletedRemoteBranch;
169 	/***/ public String doesNotExist;
170 	/***/ public String dontOverwriteLocalChanges;
171 	/***/ public String everythingUpToDate;
172 	/***/ public String expectedNumberOfbytes;
173 	/***/ public String exporting;
174 	/***/ public String failedToCommitIndex;
175 	/***/ public String failedToLockIndex;
176 	/***/ public String failedToLockTag;
177 	/***/ public String fatalError;
178 	/***/ public String fatalThisProgramWillDestroyTheRepository;
179 	/***/ public String fetchingSubmodule;
180 	/***/ public String fileIsRequired;
181 	/***/ public String ffNotPossibleAborting;
182 	/***/ public String forcedUpdate;
183 	/***/ public String fromURI;
184 	/***/ public String initializedEmptyGitRepositoryIn;
185 	/***/ public String invalidHttpProxyOnlyHttpSupported;
186 	/***/ public String invalidRecurseSubmodulesMode;
187 	/***/ public String invalidUntrackedFilesMode;
188 	/***/ public String jgitVersion;
189 	/***/ public String lfsNoAccessKey;
190 	/***/ public String lfsNoSecretKey;
191 	/***/ public String lfsProtocolUrl;
192 	/***/ public String lfsStoreDirectory;
193 	/***/ public String lfsStoreUrl;
194 	/***/ public String lfsUnknownStoreType;
195 	/***/ public String lineFormat;
196 	/***/ public String listeningOn;
197 	/***/ public String mergeCheckoutConflict;
198 	/***/ public String mergeConflict;
199 	/***/ public String mergeFailed;
200 	/***/ public String mergeCheckoutFailed;
201 	/***/ public String mergeMadeBy;
202 	/***/ public String mergedSquashed;
203 	/***/ public String mergeWentWellStoppedBeforeCommitting;
204 	/***/ public String metaVar_KEY;
205 	/***/ public String metaVar_archiveFormat;
206 	/***/ public String metaVar_archivePrefix;
207 	/***/ public String metaVar_arg;
208 	/***/ public String metaVar_author;
209 	/***/ public String metaVar_bucket;
210 	/***/ public String metaVar_command;
211 	/***/ public String metaVar_commandDetail;
212 	/***/ public String metaVar_commitOrTag;
213 	/***/ public String metaVar_commitPaths;
214 	/***/ public String metaVar_commitish;
215 	/***/ public String metaVar_configFile;
216 	/***/ public String metaVar_connProp;
217 	/***/ public String metaVar_diffAlg;
218 	/***/ public String metaVar_directory;
219 	/***/ public String metaVar_file;
220 	/***/ public String metaVar_filepattern;
221 	/***/ public String metaVar_gitDir;
222 	/***/ public String metaVar_hostName;
223 	/***/ public String metaVar_lfsStorage;
224 	/***/ public String metaVar_linesOfContext;
225 	/***/ public String metaVar_message;
226 	/***/ public String metaVar_n;
227 	/***/ public String metaVar_name;
228 	/***/ public String metaVar_object;
229 	/***/ public String metaVar_op;
230 	/***/ public String metaVar_pass;
231 	/***/ public String metaVar_path;
232 	/***/ public String metaVar_paths;
233 	/***/ public String metaVar_pattern;
234 	/***/ public String metaVar_port;
235 	/***/ public String metaVar_ref;
236 	/***/ public String metaVar_refs;
237 	/***/ public String metaVar_refspec;
238 	/***/ public String metaVar_remoteName;
239 	/***/ public String metaVar_s3Bucket;
240 	/***/ public String metaVar_s3Region;
241 	/***/ public String metaVar_s3StorageClass;
242 	/***/ public String metaVar_seconds;
243 	/***/ public String metaVar_service;
244 	/***/ public String metaVar_treeish;
245 	/***/ public String metaVar_uriish;
246 	/***/ public String metaVar_url;
247 	/***/ public String metaVar_user;
248 	/***/ public String metaVar_values;
249 	/***/ public String metaVar_version;
250 	/***/ public String mostCommonlyUsedCommandsAre;
251 	/***/ public String needApprovalToDestroyCurrentRepository;
252 	/***/ public String needSingleRevision;
253 	/***/ public String noGitRepositoryConfigured;
254 	/***/ public String noNamesFound;
255 	/***/ public String noSuchFile;
256 	/***/ public String noSuchRemoteRef;
257 	/***/ public String noTREESectionInIndex;
258 	/***/ public String nonFastForward;
259 	/***/ public String noSystemConsoleAvailable;
260 	/***/ public String notABranch;
261 	/***/ public String notACommit;
262 	/***/ public String notAGitRepository;
263 	/***/ public String notAJgitCommand;
264 	/***/ public String notARevision;
265 	/***/ public String notATree;
266 	/***/ public String notAValidRefName;
267 	/***/ public String notAValidCommitName;
268 	/***/ public String notAnIndexFile;
269 	/***/ public String notAnObject;
270 	/***/ public String notFound;
271 	/***/ public String notOnAnyBranch;
272 	/***/ public String noteObjectTooLargeToPrint;
273 	/***/ public String nothingToSquash;
274 	/***/ public String onBranchToBeBorn;
275 	/***/ public String onBranch;
276 	/***/ public String onlyOneMetaVarExpectedIn;
277 	/***/ public String onlyOneOfIncludeOnlyAllInteractiveCanBeUsed;
278 	/***/ public String password;
279 	/***/ public String pathspecDidNotMatch;
280 	/***/ public String pushTo;
281 	/***/ public String pathsRequired;
282 	/***/ public String refDoesNotExistOrNoCommit;
283 	/***/ public String remoteMessage;
284 	/***/ public String remoteRefObjectChangedIsNotExpectedOne;
285 	/***/ public String remoteSideDoesNotSupportDeletingRefs;
286 	/***/ public String removing;
287 	/***/ public String repaint;
288 	/***/ public String s3InvalidBucket;
289 	/***/ public String serviceNotSupported;
290 	/***/ public String skippingObject;
291 	/***/ public String statusFileListFormat;
292 	/***/ public String statusFileListFormatWithPrefix;
293 	/***/ public String statusFileListFormatUnmerged;
294 	/***/ public String statusModified;
295 	/***/ public String statusNewFile;
296 	/***/ public String statusRemoved;
297 	/***/ public String statusBothDeleted;
298 	/***/ public String statusAddedByUs;
299 	/***/ public String statusDeletedByThem;
300 	/***/ public String statusAddedByThem;
301 	/***/ public String statusDeletedByUs;
302 	/***/ public String statusBothAdded;
303 	/***/ public String statusBothModified;
304 	/***/ public String submoduleRegistered;
305 	/***/ public String switchedToNewBranch;
306 	/***/ public String switchedToBranch;
307 	/***/ public String tagAlreadyExists;
308 	/***/ public String tagLabel;
309 	/***/ public String tagNotFound;
310 	/***/ public String taggerInfo;
311 	/***/ public String timeInMilliSeconds;
312 	/***/ public String tooManyRefsGiven;
313 	/***/ public String treeIsRequired;
314 	/***/ public char[] unknownIoErrorStdout;
315 	/***/ public String unknownMergeStrategy;
316 	/***/ public String unknownSubcommand;
317 	/***/ public String unmergedPaths;
318 	/***/ public String unsupportedOperation;
319 	/***/ public String untrackedFiles;
320 	/***/ public String updating;
321 	/***/ public String usernameFor;
322 }