mirror of
https://codeberg.org/ashley/poke.git
synced 2025-06-21 22:37:01 -04:00
owo
This commit is contained in:
parent
d2874c2e5f
commit
63dab6176e
100 changed files with 12438 additions and 0 deletions
40
core/InnerTube/Models/YoutubeLocals.cs
Normal file
40
core/InnerTube/Models/YoutubeLocals.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
|
||||
namespace InnerTube.Models
|
||||
{
|
||||
public class YoutubeLocals
|
||||
{
|
||||
public Dictionary<string, string> Languages { get; set; }
|
||||
public Dictionary<string, string> Regions { get; set; }
|
||||
|
||||
public XmlDocument GetXmlDocument()
|
||||
{
|
||||
XmlDocument doc = new();
|
||||
XmlElement locals = doc.CreateElement("Locals");
|
||||
|
||||
XmlElement languages = doc.CreateElement("Languages");
|
||||
foreach (KeyValuePair<string, string> l in Languages)
|
||||
{
|
||||
XmlElement language = doc.CreateElement("Language");
|
||||
language.SetAttribute("hl", l.Key);
|
||||
language.InnerText = l.Value;
|
||||
languages.AppendChild(language);
|
||||
}
|
||||
locals.AppendChild(languages);
|
||||
|
||||
XmlElement regions = doc.CreateElement("Regions");
|
||||
foreach (KeyValuePair<string, string> r in Regions)
|
||||
{
|
||||
XmlElement region = doc.CreateElement("Region");
|
||||
region.SetAttribute("gl", r.Key);
|
||||
region.InnerText = r.Value;
|
||||
regions.AppendChild(region);
|
||||
}
|
||||
locals.AppendChild(regions);
|
||||
|
||||
doc.AppendChild(locals);
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue