E07150: text method missing for language variant
What went wrong
A text block (for internationalization) is missing implementation for one or more required language variants.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 113 (How does the text construct work for internationalization?)
How to fix it
- Add implementation for each required language
- Check which languages are configured for your project
- Ensure all text methods have all language variants
Common causes
- Forgot to add method for specific language
- New language added but text not translated
- Incomplete internationalization
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E07150: text method missing for language variant
#!ek9 defines module error.e07150.bad defines record Person firstName <- String() lastName <- String() Person() as pure -> firstName String lastName String require firstName? and lastName? this.firstName :=? String(firstName) this.lastName :=? String(lastName) default operator ? defines text for "en_GB" //This text type has a missing method, that is present in the "de version" WelcomePageText namedWelcome() -> person as Person `Welcome ${person.firstName}` defines text for "de" WelcomePageText namedWelcome() -> person as Person `Willkommen ${person.firstName}` //Deliberately add method here but not for en_GB namedWelcome() -> name as String `Willkommen ${name}`
Fixed: Every locale provides every text method
#!ek9 defines module error.e07150.good defines text for "en_GB" WelcomePageText formalWelcome() -> name as String `Good day ${name}` namedWelcome() -> name as String `Welcome ${name}` defines text for "de" WelcomePageText formalWelcome() -> name as String `Guten Tag ${name}` namedWelcome() -> name as String `Willkommen ${name}`
Questions and answers
These Q&A entries show E07150 and its fix:
Found a problem?
If EK9 reported E07150 for a program you think is valid, or did not report it where it should have, use the compiler form with the smallest program that shows it. If this page is wrong or unclear, use the documentation form. Both are at github.com/ek9lang/ek9-issues.