Skip to content

Allow using Locale constants for setting language level #945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/main/java/org/htmlunit/BrowserVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
* @author Ronald Brill
*/
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public final class BrowserVersion implements Serializable {

Check failure on line 64 in src/main/java/org/htmlunit/BrowserVersion.java

View workflow job for this annotation

GitHub Actions / PMD

[PMD] reported by reviewdog 🐶 Too many fields Raw Output: {"locations":[{"physicalLocation":{"artifactLocation":{"uri":"file:///home/runner/work/htmlunit/htmlunit/src/main/java/org/htmlunit/BrowserVersion.java"},"region":{"endColumn":2,"endLine":1103,"startColumn":59,"startLine":64}}}],"message":{"text":"Too many fields"},"ruleId":"TooManyFields","ruleIndex":0}

/** Latest Firefox. */
public static final BrowserVersion FIREFOX = new BrowserVersion(136, "FF");
Expand Down Expand Up @@ -931,6 +931,21 @@
return this;
}

/**
* Changes the browser language property. This is used for various output
* formating. If you like change the language the browser requests from the server
* you have to adjust the {@link #setAcceptLanguageHeader(String)}.
*
* @see <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Locale.html#field.detail">Locale constants</a>
* @param browserLanguage

Check failure on line 940 in src/main/java/org/htmlunit/BrowserVersion.java

View workflow job for this annotation

GitHub Actions / CheckStyle

[checkstyle] reported by reviewdog 🐶 At-clause should have a non-empty description. Raw Output: /home/runner/work/htmlunit/htmlunit/src/main/java/org/htmlunit/BrowserVersion.java:940:0: error: At-clause should have a non-empty description. (com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck)
* @return

Check failure on line 941 in src/main/java/org/htmlunit/BrowserVersion.java

View workflow job for this annotation

GitHub Actions / CheckStyle

[checkstyle] reported by reviewdog 🐶 At-clause should have a non-empty description. Raw Output: /home/runner/work/htmlunit/htmlunit/src/main/java/org/htmlunit/BrowserVersion.java:941:0: error: At-clause should have a non-empty description. (com.puppycrawl.tools.checkstyle.checks.javadoc.NonEmptyAtclauseDescriptionCheck)
*/

public BrowserVersionBuilder setBrowserLanguage(final Locale browserLanguage) {

Check failure on line 944 in src/main/java/org/htmlunit/BrowserVersion.java

View workflow job for this annotation

GitHub Actions / CheckStyle

[checkstyle] reported by reviewdog 🐶 @return tag should be present and have description. Raw Output: /home/runner/work/htmlunit/htmlunit/src/main/java/org/htmlunit/BrowserVersion.java:944:0: error: @return tag should be present and have description. (com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck)
workPiece_.browserLocale_ = browserLanguage;
return this;
}

/**
* @param onLine the onLine to set
* @return this for fluent use
Expand Down
Loading