Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import okhttp3.HttpUrl;

public abstract class BaseWPComRestClient {
private static final String WPCOM_V2_PREFIX = "/wpcom/v2";
private static final String WPCOM_V1_PREFIX = "/wpcom/v1";
private static final String LOCALE_PARAM_NAME_FOR_V1 = "locale";
private static final String LOCALE_PARAM_NAME_FOR_V2 = "_locale";

Expand Down Expand Up @@ -152,7 +152,7 @@ private void addAcceptHeaderIfNeeded(BaseRequest request) {


private @NonNull String getLocaleParamName(@NonNull String url) {
return url.contains(WPCOM_V2_PREFIX) ? LOCALE_PARAM_NAME_FOR_V2 : LOCALE_PARAM_NAME_FOR_V1;
return url.contains(WPCOM_V1_PREFIX) ? LOCALE_PARAM_NAME_FOR_V1 : LOCALE_PARAM_NAME_FOR_V2;
}

protected @Nullable HttpUrl getHttpUrlWithLocale(@NonNull String url) {
Expand Down