Re-import a bilingual file
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form 'locale=<string>' \
--form 'filePath=<string>' \
--form 'branch=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('locale', '<string>');
form.append('filePath', '<string>');
form.append('branch', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"locale": "<string>",
"filePath": "<string>",
"branch": "<string>"
}
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"locale\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filePath\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"branch\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"import": {
"matched": 1,
"imported": 1,
"skipped": 1,
"files": 1
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Bilingual files
Re-import a bilingual file
Requires translations:approve (admins, localization managers and reviewers). Native projects only. Saves each row’s target text as an approved, imported translation of the string with the same key and file on the chosen native version branch (branch; omit or leave empty for main). Rows without a key or target text, for another locale, for an unknown string, for a locked segment, or longer than the string’s maxLength are skipped. With filePath, rows that name no file belong to it and rows that name another file are skipped. The format comes from the file name unless format is set.
POST
https://public-api.hyperlocalise.com
/
v1
/
projects
/
{projectId}
/
bilingual-file
Re-import a bilingual file
curl --request POST \
--url https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file \
--header 'Content-Type: multipart/form-data' \
--header 'x-api-key: <api-key>' \
--form file=@example-file \
--form 'locale=<string>' \
--form 'filePath=<string>' \
--form 'branch=<string>'const form = new FormData();
form.append('file', '<string>');
form.append('locale', '<string>');
form.append('filePath', '<string>');
form.append('branch', '<string>');
const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
options.body = form;
fetch('https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"locale": "<string>",
"filePath": "<string>",
"branch": "<string>"
}
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://public-api.hyperlocalise.com/v1/projects/{projectId}/bilingual-file"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"locale\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"filePath\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"branch\"\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"import": {
"matched": 1,
"imported": 1,
"skipped": 1,
"files": 1
}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Body
multipart/form-data
Was this page helpful?

