mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-28 14:02:51 +00:00
LibWeb+LibWebView+UI: Migrate to LibWebView's language settings
This commit is contained in:
parent
f242920cc9
commit
a3ea4881e7
Notes:
github-actions[bot]
2025-04-04 08:17:32 +00:00
Author: https://github.com/trflynn89
Commit: a3ea4881e7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4215
Reviewed-by: https://github.com/gmta ✅
13 changed files with 14 additions and 148 deletions
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Span.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibWeb/Loader/ResourceLoader.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
@ -16,10 +16,10 @@ namespace Web::HTML {
|
|||
class NavigatorLanguageMixin {
|
||||
public:
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language
|
||||
String language() const { return ResourceLoader::the().preferred_languages()[0]; }
|
||||
String const& language() const { return ResourceLoader::the().preferred_languages()[0]; }
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-languages
|
||||
Vector<String> languages() const { return ResourceLoader::the().preferred_languages(); }
|
||||
ReadonlySpan<String> languages() const { return ResourceLoader::the().preferred_languages(); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue