UALocalizedText.ts 507 B

1234567891011121314
  1. import { XMLElem, type IToXML } from "@/util/XmlElem";
  2. export class UALocalizedText implements IToXML{
  3. constructor(public tagName: string,
  4. public text: string,
  5. public locale: string) {
  6. }
  7. toXML(): XMLElem {
  8. return new XMLElem(this.tagName, this.text).attr('Locale', this.locale);
  9. }
  10. static fromXML(tagName: string, xmlObject: any): UALocalizedText {
  11. return new UALocalizedText(tagName, xmlObject['#text'], xmlObject['@_Locale']);
  12. }
  13. }