Skip to content

Commit

Permalink
Scraper: getLanguage uses already 2 letters code apparently even if s…
Browse files Browse the repository at this point in the history
…ystem uses language variant
  • Loading branch information
courville committed Aug 11, 2024
1 parent 594e345 commit fcac4bc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/com/archos/mediascraper/Scraper.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ public ScrapeDetailResult getAutoDetails(SearchInfo info) {
public static String getLanguage(Context context) {
String defaultLanguage = Locale.getDefault().getLanguage();
String result;
// TO CHECK: perhaps below code does not do much since Locale.getDefault().getLanguage() returns 2 letter codes even if a variant of the language is used
log.debug("getLanguage: defaultScraperLanguage=" + defaultLanguage);
// if defaultLanguage is of the form xx-yy take result as xx
if (defaultLanguage.length() > 2 && defaultLanguage.charAt(2) == '-') {
result = defaultLanguage.substring(0, 2);
Expand Down

0 comments on commit fcac4bc

Please sign in to comment.