PathTranslator class
Translates URL path segments between canonical (English) and localized forms.
Built automatically by SINT when translateEndpoints: true is set on
SintMaterialApp. Uses the app's registered translations to derive
segment mappings — no external localization file needed.
Example:
- ES:
/book/abc123↔/libro/abc123 - FR:
/book/abc123↔/livre/abc123
Constructors
-
PathTranslator.build({required Map<
String, Map< translations, required Set<String, String> >String> routeSegments}) -
Builds a PathTranslator from SINT's loaded translations and the
static route segments extracted from registered SintPage names.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
canonicalizePath(
String path) → String - Canonicalizes a localized URL path to canonical English.
-
localizePath(
String path, String languageCode) → String - Localizes a canonical English path to the given language code.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
extractSegments(
List routes) → Set< String> - Extracts unique static segments from registered route names.