| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import { language_pl_pl } from "../languages/pl_pl";
- export class phrase {
- #text;
- static #dictionary;
- static #init() {
- phrase.#dictionary = language_pl_pl;
- }
- get dictionary() {
- if (!phrase.#dictionary) {
- phrase.#init()
- }
- return phrase.#dictionary;
- }
- constructor(location) {
- const splited = location.split(".");
- let dict = this.dictionary;
- for (let count in splited) {
- if (!(splited[count] in dict)) {
- this.#text = location;
- break;
- }
- dict = dict[splited[count]];
- }
-
- if (!this.#text) {
- this.#text = dict;
- }
- }
- toString() {
- return this.#text;
- }
- get text() {
- return this.#text;
- }
- }
|