/** * Replaces the locale/language variables in a given input string by their runtime values. * If one of the locale passed is null, its corresponding variables are replaced by an empty string. * @param input the string with the variables. * @param srcLoc the source locale code (can be null). * @param trgLoc the target locale code (can be null). * @return the modified string. */ static public String replaceVariables(String input, String srcLoc, String trgLoc) { return replaceVariables(input, LocaleId.fromString(srcLoc == null ? "" : srcLoc), LocaleId.fromString(trgLoc == null ? "" : trgLoc)); }
cmd = cmd.replace("${trgLangName}", loc.getDisplayLanguage(Locale.ENGLISH)); cmd = LocaleId.replaceVariables(cmd, srcLoc, trgLoc);
propFile = Util.fillRootDirectoryVariable(propFile, rootDir); propFile = Util.fillInputRootDirectoryVariable(propFile, inputRootDir); propFile = LocaleId.replaceVariables(propFile, sourceLocale, targetLocale);
tmxOutputPath = LocaleId.replaceVariables(tmxOutputPath, sourceLocale, targetLocale); tmxWriter = new TMXWriter(tmxOutputPath); tmxWriter.writeStartDocument(sourceLocale, targetLocale, getClass().getCanonicalName(),
destination = LocaleId.replaceVariables(destination, manifest.getSourceLocale(), manifest.getTargetLocale()); origin = LocaleId.replaceVariables(origin, manifest.getSourceLocale(), manifest.getTargetLocale());
tmxOutputPath = LocaleId.replaceVariables(tmxOutputPath, srcLoc, trgLoc); String existingTMPath = Util.fillRootDirectoryVariable(params.getExistingTm(), rootDir); existingTMPath = Util.fillInputRootDirectoryVariable(existingTMPath, inputRootDir); existingTMPath = LocaleId.replaceVariables(existingTMPath, srcLoc, trgLoc); existingTm = TmSeekerFactory.createFileBasedTmSeeker(existingTMPath); String srxPath = Util.fillRootDirectoryVariable(params.getSrxPath(), rootDir); srxPath = Util.fillInputRootDirectoryVariable(srxPath, inputRootDir); srxPath = LocaleId.replaceVariables(srxPath, srcLoc, trgLoc); srxDoc.loadRules(srxPath);
resolvedOutputDir = Util.fillRootDirectoryVariable(resolvedOutputDir, rootDir); resolvedOutputDir = Util.fillInputRootDirectoryVariable(resolvedOutputDir, inputRootDir); resolvedOutputDir = LocaleId.replaceVariables(resolvedOutputDir, srcLoc, trgLoc);
String resolvedPath = Util.fillRootDirectoryVariable(params.getTmxPath(), rootDir); resolvedPath = Util.fillInputRootDirectoryVariable(resolvedPath, inputRootDir); resolvedPath = LocaleId.replaceVariables(resolvedPath, sourceLocale, targetLocale); tmx = new TMXWriter(resolvedPath); tmx.writeStartDocument(sourceLocale, targetLocale,
tmxOutputPath = Util.fillRootDirectoryVariable(params.getTmxPath(), rootDir); tmxOutputPath = Util.fillInputRootDirectoryVariable(tmxOutputPath, inputRootDir); tmxOutputPath = LocaleId.replaceVariables(tmxOutputPath, sourceLocale, targetLocale); tmxWriter = new TMXWriter(tmxOutputPath); tmxWriter.writeStartDocument(sourceLocale, targetLocale, getClass().getCanonicalName(),
String tmDir = Util.fillRootDirectoryVariable(params.getTmDirectory(), rootDir); tmDir = Util.fillInputRootDirectoryVariable(tmDir, inputRootDir); tmDir = LocaleId.replaceVariables(tmDir, srcLoc, trgLoc); Util.createDirectories(tmDir+File.separator);
realPath = LocaleId.replaceVariables(realPath, sourceLocale, targetLocale);