Skip to content

Commit

Permalink
Allow override of language #64
Browse files Browse the repository at this point in the history
  • Loading branch information
germanattanasio committed May 9, 2016
1 parent 3a11f3f commit 6fd2e07
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ public class AlchemyLanguage extends AlchemyService {
/** The Constant ANCHOR_DATE. */
public static final String ANCHOR_DATE = "anchorDate";

// language to be used with request
private LanguageSelection language = LanguageSelection.DETECT;

private static final SimpleDateFormat anchorDateFormat =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

private static final String LANGUAGE = "language";

/**
* Execute the request and return the POJO that represent the response.
*
Expand All @@ -168,8 +169,8 @@ private <T extends AlchemyGenericModel> ServiceCall<T> createServiceCall(Map<Str
// Return json
params.put(OUTPUT_MODE, "json");

if (language != LanguageSelection.DETECT) {
params.put("language", language.toString().toLowerCase());
if (!params.containsKey(LANGUAGE) && language != LanguageSelection.DETECT) {
params.put(LANGUAGE, language.toString().toLowerCase());
}

// Prevent jsonp to be returned
Expand Down

0 comments on commit 6fd2e07

Please sign in to comment.