Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 3c288bf

Browse files
authored
Merge pull request #2940 from wordpress-mobile/fix/cherrypick_locale_v3_fix
Cherry picking #2938 in 2.59.2
2 parents aaafa4c + 2695646 commit 3c288bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fluxc/src/main/java/org/wordpress/android/fluxc/network/rest/wpcom/BaseWPComRestClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
import okhttp3.HttpUrl;
2727

2828
public abstract class BaseWPComRestClient {
29-
private static final String WPCOM_V1_PREFIX = "/wpcom/v1";
29+
private static final String WPCOM_V2_PREFIX = "/wpcom/v2";
30+
private static final String WPCOM_V3_PREFIX = "/wpcom/v3";
3031
private static final String LOCALE_PARAM_NAME_FOR_V1 = "locale";
3132
private static final String LOCALE_PARAM_NAME_FOR_V2 = "_locale";
3233

@@ -152,7 +153,8 @@ private void addAcceptHeaderIfNeeded(BaseRequest request) {
152153

153154

154155
private @NonNull String getLocaleParamName(@NonNull String url) {
155-
return url.contains(WPCOM_V1_PREFIX) ? LOCALE_PARAM_NAME_FOR_V1 : LOCALE_PARAM_NAME_FOR_V2;
156+
return url.contains(WPCOM_V2_PREFIX) || url.contains(WPCOM_V3_PREFIX) ? LOCALE_PARAM_NAME_FOR_V2
157+
: LOCALE_PARAM_NAME_FOR_V1;
156158
}
157159

158160
protected @Nullable HttpUrl getHttpUrlWithLocale(@NonNull String url) {

0 commit comments

Comments
 (0)