Class TranslationUtils

java.lang.Object
com.e1c.langtool.TranslationUtils

public class TranslationUtils extends Object
  • Method Details

    • getTranslationSource

      public static TranslationSource getTranslationSource(Object object)
      Gets the translation source from given object, that can be IAdaptable or has registered adapter to TranslationSource.
      Parameters:
      object - the object, may be null.
      Returns:
      the translation source or null if cannot be adapted.
    • isModelLanguage

      public static boolean isModelLanguage(TranslateLanguage language)
      Checks if the language is model language.
      Parameters:
      language - the language to check, cannot be null
      Returns:
      true, if the language is model language
    • isValidFeatureForLanguage

      public static boolean isValidFeatureForLanguage(FeatureSettings featureSettings, TranslateLanguage language)
      Checks if the feature described with FeatureSettings is valid for the language.
      Parameters:
      featureSettings - the feature settings, cannot be null
      language - the language, cannot be null
      Returns:
      true, if the feature is valid for the language
    • isValidValueForCollectModelType

      public static boolean isValidValueForCollectModelType(boolean isComputed, boolean isUnknown, boolean isTag, ICollectingParameters.CollectModelType collectModelType)
      Checks if the value is valid for given collect model type.
      Parameters:
      isComputed - the computed model value
      isUnknown - the unknown model value
      isTag - the is tag or tag parameter
      collectModelType - the collect model type, cannot be null
      Returns:
      true, if the value is valid for collect model type
    • getProjectInterfaceLanguageCodes

      public static Set<String> getProjectInterfaceLanguageCodes(ITranslatingProject project)
      Return set of interface language codes for given project. Note that main language code are not included into this list.
      Parameters:
      project - Project, shall not be null.
      Returns:
      Set of project's interface language codes.
    • computePoolSize

      public static int computePoolSize(boolean forced)
      Compute execution pool size depends on available CPU and RAM memory.
      Parameters:
      forced - the forced to get by CPU number, without RAM memory calculation.
      Returns:
      the number of threads for the pull
    • getTranslationSourceFile

      public static org.eclipse.core.resources.IFile getTranslationSourceFile(ContextTranslationKey contextKey)
      Gets the translation source file.
      Parameters:
      contextKey - the context key, cannot be null.
      Returns:
      the translation source file, cannot return null.
    • startCleanUpMapDbFiles

      public static void startCleanUpMapDbFiles(File file)
      Start clean up MapDB files in separate job. This method doesn't wait the completion of the job.
      Parameters:
      file - the file, cannot be null.
    • cleanUpMabDbFiles

      public static void cleanUpMabDbFiles(File file)
      Clean up MapDB files with it's p-file.
      Parameters:
      file - the main MapDB file to remove, cannot be null.