mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:54:58 +00:00
LibWeb: Port NavigatorLanguage from DeprecatedString
This commit is contained in:
parent
a8f5ebeddd
commit
c4d3134436
1 changed files with 4 additions and 4 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -14,15 +14,15 @@ namespace Web::HTML {
|
|||
class NavigatorLanguageMixin {
|
||||
public:
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language
|
||||
DeprecatedString language() const { return m_current_preferred_languages[0]; }
|
||||
String language() const { return m_current_preferred_languages[0]; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-languages
|
||||
// FIXME: The same object must be returned until the user agent needs to return different values, or values in a
|
||||
// different order.
|
||||
Vector<DeprecatedString> languages() const { return m_current_preferred_languages; }
|
||||
Vector<String> languages() const { return m_current_preferred_languages; }
|
||||
|
||||
protected:
|
||||
Vector<DeprecatedString> m_current_preferred_languages = { "en-US" };
|
||||
Vector<String> m_current_preferred_languages = { "en-US"_string };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue