You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CLIText.java 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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. package org.eclipse.jgit.pgm.internal;
  45. import java.text.MessageFormat;
  46. import java.util.Locale;
  47. import org.eclipse.jgit.nls.NLS;
  48. import org.eclipse.jgit.nls.TranslationBundle;
  49. import org.kohsuke.args4j.Localizable;
  50. /**
  51. * Translation bundle for JGit command line interface
  52. */
  53. public class CLIText extends TranslationBundle {
  54. /**
  55. * Formats text strings using {@code Localizable}.
  56. *
  57. */
  58. public static class Format implements Localizable {
  59. final String text;
  60. Format(String text) {
  61. this.text = text;
  62. }
  63. @Override
  64. public String formatWithLocale(Locale locale, Object... args) {
  65. // we don't care about Locale for now
  66. return format(args);
  67. }
  68. @Override
  69. public String format(Object... args) {
  70. return MessageFormat.format(text, args);
  71. }
  72. }
  73. /**
  74. * Format text
  75. *
  76. * @param text
  77. * the text to format.
  78. * @return a new Format instance.
  79. */
  80. public static Format format(String text) {
  81. return new Format(text);
  82. }
  83. /**
  84. * Get an instance of this translation bundle
  85. *
  86. * @return an instance of this translation bundle
  87. */
  88. public static CLIText get() {
  89. return NLS.getBundleFor(CLIText.class);
  90. }
  91. /**
  92. * Format the given line for using the format defined by {@link #lineFormat}
  93. * ("# " by default).
  94. *
  95. * @param line
  96. * the line to format
  97. * @return the formatted line
  98. */
  99. public static String formatLine(String line) {
  100. return MessageFormat.format(get().lineFormat, line);
  101. }
  102. /**
  103. * Format the given argument as fatal error using the format defined by
  104. * {@link #fatalError} ("fatal: " by default).
  105. *
  106. * @param message
  107. * the message to format
  108. * @return the formatted line
  109. */
  110. public static String fatalError(String message) {
  111. return MessageFormat.format(get().fatalError, message);
  112. }
  113. // @formatter:off
  114. /***/ public String alreadyOnBranch;
  115. /***/ public String alreadyUpToDate;
  116. /***/ public String answerNo;
  117. /***/ public String answerYes;
  118. /***/ public String authorInfo;
  119. /***/ public String averageMSPerRead;
  120. /***/ public String branchAlreadyExists;
  121. /***/ public String branchCreatedFrom;
  122. /***/ public String branchDetachedHEAD;
  123. /***/ public String branchIsNotAnAncestorOfYourCurrentHEAD;
  124. /***/ public String branchNameRequired;
  125. /***/ public String branchNotFound;
  126. /***/ public String cacheTreePathInfo;
  127. /***/ public String configFileNotFound;
  128. /***/ public String cannotBeRenamed;
  129. /***/ public String cannotCombineSquashWithNoff;
  130. /***/ public String cannotCreateCommand;
  131. /***/ public String cannotCreateOutputStream;
  132. /***/ public String cannotDeatchHEAD;
  133. /***/ public String cannotDeleteFile;
  134. /***/ public String cannotDeleteTheBranchWhichYouAreCurrentlyOn;
  135. /***/ public String cannotGuessLocalNameFrom;
  136. /***/ public String cannotLock;
  137. /***/ public String cannotReadBecause;
  138. /***/ public String cannotReadPackageInformation;
  139. /***/ public String cannotRenameDetachedHEAD;
  140. /***/ public String cannotResolve;
  141. /***/ public String cannotSetupConsole;
  142. /***/ public String cannotUseObjectsWithGlog;
  143. /***/ public String cantFindGitDirectory;
  144. /***/ public String cantWrite;
  145. /***/ public String changesNotStagedForCommit;
  146. /***/ public String changesToBeCommitted;
  147. /***/ public String checkingOut;
  148. /***/ public String checkoutConflict;
  149. /***/ public String checkoutConflictPathLine;
  150. /***/ public String cleanRequireForce;
  151. /***/ public String clonedEmptyRepository;
  152. /***/ public String cloningInto;
  153. /***/ public String commitLabel;
  154. /***/ public String conflictingUsageOf_git_dir_andArguments;
  155. /***/ public String couldNotCreateBranch;
  156. /***/ public String dateInfo;
  157. /***/ public String deletedBranch;
  158. /***/ public String deletedRemoteBranch;
  159. /***/ public String doesNotExist;
  160. /***/ public String dontOverwriteLocalChanges;
  161. /***/ public String everythingUpToDate;
  162. /***/ public String expectedNumberOfbytes;
  163. /***/ public String exporting;
  164. /***/ public String failedToCommitIndex;
  165. /***/ public String failedToLockIndex;
  166. /***/ public String fatalError;
  167. /***/ public String fatalThisProgramWillDestroyTheRepository;
  168. /***/ public String fetchingSubmodule;
  169. /***/ public String fileIsRequired;
  170. /***/ public String ffNotPossibleAborting;
  171. /***/ public String forcedUpdate;
  172. /***/ public String fromURI;
  173. /***/ public String initializedEmptyGitRepositoryIn;
  174. /***/ public String invalidHttpProxyOnlyHttpSupported;
  175. /***/ public String invalidRecurseSubmodulesMode;
  176. /***/ public String invalidUntrackedFilesMode;
  177. /***/ public String jgitVersion;
  178. /***/ public String lfsNoAccessKey;
  179. /***/ public String lfsNoSecretKey;
  180. /***/ public String lfsProtocolUrl;
  181. /***/ public String lfsStoreDirectory;
  182. /***/ public String lfsStoreUrl;
  183. /***/ public String lfsUnknownStoreType;
  184. /***/ public String lineFormat;
  185. /***/ public String listeningOn;
  186. /***/ public String mergeCheckoutConflict;
  187. /***/ public String mergeConflict;
  188. /***/ public String mergeFailed;
  189. /***/ public String mergeCheckoutFailed;
  190. /***/ public String mergeMadeBy;
  191. /***/ public String mergedSquashed;
  192. /***/ public String mergeWentWellStoppedBeforeCommitting;
  193. /***/ public String metaVar_KEY;
  194. /***/ public String metaVar_archiveFormat;
  195. /***/ public String metaVar_archivePrefix;
  196. /***/ public String metaVar_arg;
  197. /***/ public String metaVar_author;
  198. /***/ public String metaVar_bucket;
  199. /***/ public String metaVar_command;
  200. /***/ public String metaVar_commandDetail;
  201. /***/ public String metaVar_commitOrTag;
  202. /***/ public String metaVar_commitPaths;
  203. /***/ public String metaVar_commitish;
  204. /***/ public String metaVar_configFile;
  205. /***/ public String metaVar_connProp;
  206. /***/ public String metaVar_diffAlg;
  207. /***/ public String metaVar_directory;
  208. /***/ public String metaVar_file;
  209. /***/ public String metaVar_filepattern;
  210. /***/ public String metaVar_gitDir;
  211. /***/ public String metaVar_hostName;
  212. /***/ public String metaVar_lfsStorage;
  213. /***/ public String metaVar_linesOfContext;
  214. /***/ public String metaVar_message;
  215. /***/ public String metaVar_n;
  216. /***/ public String metaVar_name;
  217. /***/ public String metaVar_object;
  218. /***/ public String metaVar_op;
  219. /***/ public String metaVar_pass;
  220. /***/ public String metaVar_path;
  221. /***/ public String metaVar_paths;
  222. /***/ public String metaVar_pattern;
  223. /***/ public String metaVar_port;
  224. /***/ public String metaVar_ref;
  225. /***/ public String metaVar_refs;
  226. /***/ public String metaVar_refspec;
  227. /***/ public String metaVar_remoteName;
  228. /***/ public String metaVar_s3Bucket;
  229. /***/ public String metaVar_s3Region;
  230. /***/ public String metaVar_s3StorageClass;
  231. /***/ public String metaVar_seconds;
  232. /***/ public String metaVar_service;
  233. /***/ public String metaVar_treeish;
  234. /***/ public String metaVar_uriish;
  235. /***/ public String metaVar_url;
  236. /***/ public String metaVar_user;
  237. /***/ public String metaVar_values;
  238. /***/ public String metaVar_version;
  239. /***/ public String mostCommonlyUsedCommandsAre;
  240. /***/ public String needApprovalToDestroyCurrentRepository;
  241. /***/ public String needSingleRevision;
  242. /***/ public String noGitRepositoryConfigured;
  243. /***/ public String noNamesFound;
  244. /***/ public String noSuchFile;
  245. /***/ public String noTREESectionInIndex;
  246. /***/ public String nonFastForward;
  247. /***/ public String noSystemConsoleAvailable;
  248. /***/ public String notABranch;
  249. /***/ public String notACommit;
  250. /***/ public String notAGitRepository;
  251. /***/ public String notAJgitCommand;
  252. /***/ public String notARevision;
  253. /***/ public String notATree;
  254. /***/ public String notAValidRefName;
  255. /***/ public String notAValidCommitName;
  256. /***/ public String notAnIndexFile;
  257. /***/ public String notAnObject;
  258. /***/ public String notFound;
  259. /***/ public String notOnAnyBranch;
  260. /***/ public String noteObjectTooLargeToPrint;
  261. /***/ public String nothingToSquash;
  262. /***/ public String onBranchToBeBorn;
  263. /***/ public String onBranch;
  264. /***/ public String onlyOneMetaVarExpectedIn;
  265. /***/ public String onlyOneOfIncludeOnlyAllInteractiveCanBeUsed;
  266. /***/ public String password;
  267. /***/ public String pathspecDidNotMatch;
  268. /***/ public String pushTo;
  269. /***/ public String pathsRequired;
  270. /***/ public String refDoesNotExistOrNoCommit;
  271. /***/ public String remoteMessage;
  272. /***/ public String remoteRefObjectChangedIsNotExpectedOne;
  273. /***/ public String remoteSideDoesNotSupportDeletingRefs;
  274. /***/ public String removing;
  275. /***/ public String repaint;
  276. /***/ public String s3InvalidBucket;
  277. /***/ public String serviceNotSupported;
  278. /***/ public String skippingObject;
  279. /***/ public String statusFileListFormat;
  280. /***/ public String statusFileListFormatWithPrefix;
  281. /***/ public String statusFileListFormatUnmerged;
  282. /***/ public String statusModified;
  283. /***/ public String statusNewFile;
  284. /***/ public String statusRemoved;
  285. /***/ public String statusBothDeleted;
  286. /***/ public String statusAddedByUs;
  287. /***/ public String statusDeletedByThem;
  288. /***/ public String statusAddedByThem;
  289. /***/ public String statusDeletedByUs;
  290. /***/ public String statusBothAdded;
  291. /***/ public String statusBothModified;
  292. /***/ public String submoduleRegistered;
  293. /***/ public String switchedToNewBranch;
  294. /***/ public String switchedToBranch;
  295. /***/ public String tagAlreadyExists;
  296. /***/ public String tagLabel;
  297. /***/ public String tagNotFound;
  298. /***/ public String taggerInfo;
  299. /***/ public String timeInMilliSeconds;
  300. /***/ public String tooManyRefsGiven;
  301. /***/ public String treeIsRequired;
  302. /***/ public char[] unknownIoErrorStdout;
  303. /***/ public String unknownMergeStrategy;
  304. /***/ public String unknownSubcommand;
  305. /***/ public String unmergedPaths;
  306. /***/ public String unsupportedOperation;
  307. /***/ public String untrackedFiles;
  308. /***/ public String updating;
  309. /***/ public String usernameFor;
  310. }