Class CreateProjectNameUtil
java.lang.Object
com.idmedia.translationstudio.impl.util.CreateProjectNameUtil
Create TMS project names
- Author:
- I-D Media AG
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Stringcreate(@NotNull String sNameTemplate, @NotNull String sPlaceholderName, @NotNull String sPlaceholderLanguageSourcce, @NotNull String sPlaceholderLanguageTarget, @NotNull String sPlaceholderPage) Create a namestatic @NotNull Stringcreate(@NotNull String sNameTemplate, @NotNull String sPlaceholderName, @NotNull String sPlaceholderLanguageSourcce, @NotNull String sPlaceholderLanguageTarget, @NotNull String sPlaceholderPage, @NotNull String sPlaceholderPageId) Create a namestatic @NotNull Stringcreate(@NotNull String sNameTemplate, @NotNull String sPlaceholderName, @NotNull String sPlaceholderLanguageSourcce, @NotNull String sPlaceholderLanguageTarget, @NotNull String sPlaceholderPage, @NotNull String sPlaceholderPageId, @NotNull String sPlaceholderProjectName) Create a namestatic @NotNull StringensureMaxLength(@NotNull String sValue, int nMaxLen) Ensure a string does not exceed the given length.static @NotNull StringgetDisplayNames(@NotNull List<ITranslatableFile> vpFiles, int nMaxLen) static @NotNull StringremoveInvalidFilenameCharacters(@NotNull String sInput) Replace invalid chars from a given input
-
Method Details
-
create
@NotNull public static @NotNull String create(@NotNull @NotNull String sNameTemplate, @NotNull @NotNull String sPlaceholderName, @NotNull @NotNull String sPlaceholderLanguageSourcce, @NotNull @NotNull String sPlaceholderLanguageTarget, @NotNull @NotNull String sPlaceholderPage) Create a name- Parameters:
sNameTemplate- TemplatesPlaceholderName- {name} replacementsPlaceholderLanguageSourcce- {source} replacementsPlaceholderLanguageTarget- {target} replacementsPlaceholderPage- {page} replacement (concatinated display names)- Returns:
-
create
@NotNull public static @NotNull String create(@NotNull @NotNull String sNameTemplate, @NotNull @NotNull String sPlaceholderName, @NotNull @NotNull String sPlaceholderLanguageSourcce, @NotNull @NotNull String sPlaceholderLanguageTarget, @NotNull @NotNull String sPlaceholderPage, @NotNull @NotNull String sPlaceholderPageId) Create a name- Parameters:
sNameTemplate- TemplatesPlaceholderName- {name} replacementsPlaceholderLanguageSourcce- {source} replacementsPlaceholderLanguageTarget- {target} replacementsPlaceholderPage- {page} replacement (concatinated display names)sPlaceholderPageId- {pageid} replacement- Returns:
-
create
@NotNull public static @NotNull String create(@NotNull @NotNull String sNameTemplate, @NotNull @NotNull String sPlaceholderName, @NotNull @NotNull String sPlaceholderLanguageSourcce, @NotNull @NotNull String sPlaceholderLanguageTarget, @NotNull @NotNull String sPlaceholderPage, @NotNull @NotNull String sPlaceholderPageId, @NotNull @NotNull String sPlaceholderProjectName) Create a name- Parameters:
sNameTemplate- TemplatesPlaceholderName- {name} replacementsPlaceholderLanguageSourcce- {source} replacementsPlaceholderLanguageTarget- {target} replacementsPlaceholderPage- {page} replacement (concatinated display names)sPlaceholderPageId- {pageid} replacementsPlaceholderProjectName- {projectname} replacement- Returns:
-
ensureMaxLength
@NotNull public static @NotNull String ensureMaxLength(@NotNull @NotNull String sValue, int nMaxLen) Ensure a string does not exceed the given length. If so, replace the last 3 characters with "..."- Parameters:
sValue-nMaxLen-- Returns:
-
removeInvalidFilenameCharacters
@NotNull public static @NotNull String removeInvalidFilenameCharacters(@NotNull @NotNull String sInput) Replace invalid chars from a given input- Parameters:
sInput-- Returns:
-
getDisplayNames
@NotNull public static @NotNull String getDisplayNames(@NotNull @NotNull List<ITranslatableFile> vpFiles, int nMaxLen)
-