Skip to content

Commit

Permalink
fix: fix invalid path to fetch translations
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Nov 22, 2023
1 parent 078a420 commit e549700
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
Expand All @@ -12,6 +13,7 @@

@Service
@RequiredArgsConstructor
@Slf4j
public class TranlationMangementServiceApiClient {

@Value("${weblate.api.url}")
Expand All @@ -28,9 +30,10 @@ public String tryFetchTranslationsFromTranslationManagementService(String projec
String component, String languageCode) {
HttpHeaders headers = new HttpHeaders();
headers.set("Authorization", "Token " + apiKey);
String url = apiUrl + "translations/" + project + "/" + component + "/test" + "/" + languageCode
String url = apiUrl + "translations/" + project + "/" + component + "/" + languageCode
+ "/file.json";

log.info("Calling url to fetch translations: {}", url);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET,
new HttpEntity<>(headers), String.class);
return response.getBody();
Expand Down

0 comments on commit e549700

Please sign in to comment.