Class CreateProjectNameUtil

java.lang.Object
com.idmedia.translationstudio.impl.util.CreateProjectNameUtil

public class CreateProjectNameUtil extends Object
Create TMS project names
Author:
I-D Media AG
  • 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 - Template
      sPlaceholderName - {name} replacement
      sPlaceholderLanguageSourcce - {source} replacement
      sPlaceholderLanguageTarget - {target} replacement
      sPlaceholderPage - {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 - Template
      sPlaceholderName - {name} replacement
      sPlaceholderLanguageSourcce - {source} replacement
      sPlaceholderLanguageTarget - {target} replacement
      sPlaceholderPage - {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 - Template
      sPlaceholderName - {name} replacement
      sPlaceholderLanguageSourcce - {source} replacement
      sPlaceholderLanguageTarget - {target} replacement
      sPlaceholderPage - {page} replacement (concatinated display names)
      sPlaceholderPageId - {pageid} replacement
      sPlaceholderProjectName - {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)