Class DoNotTranslate

java.lang.Object
org.nuclos.api.l10n.DoNotTranslate
All Implemented Interfaces:
CharSequence

public class DoNotTranslate extends Object implements CharSequence
A wrapper class for strings that should not be translated by the localization system. This class marks strings to be excluded from the translation process. It implements CharSequence to maintain compatibility with string operations.
  • Constructor Details

    • DoNotTranslate

      public DoNotTranslate(String s)
      Creates a new DoNotTranslate instance with the specified string.
      Parameters:
      s - The string that should not be translated
      Throws:
      IllegalArgumentException - If the provided string is null
  • Method Details

    • length

      public int length()
      Returns the length of the wrapped string.
      Specified by:
      length in interface CharSequence
      Returns:
      The length of the wrapped string
    • charAt

      public char charAt(int index)
      Returns the character at the specified index in the wrapped string.
      Specified by:
      charAt in interface CharSequence
      Parameters:
      index - The index of the character to return
      Returns:
      The character at the specified index
    • subSequence

      public CharSequence subSequence(int start, int end)
      Returns a new DoNotTranslate instance that contains a subsequence of the wrapped string.
      Specified by:
      subSequence in interface CharSequence
      Parameters:
      start - The start index, inclusive
      end - The end index, exclusive
      Returns:
      A new DoNotTranslate instance containing the specified subsequence
    • toString

      public String toString()
      Returns the wrapped string.
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object
      Returns:
      The string that is not to be translated