This documentation outlines the API endpoints provided for interacting with a project's translation data.
GET /{id}
Fetches the export of a project's data.
Support formats: python, json, go, js ... for more template please make a pull request.
id(path variable) - Unique identifier for the project.file(query) - The name of the export file, including its extension to determine the file type.notes(query, optional) - Translation notes to include.languages(query, optional) - Comma-separated list of languages to export.template(query, optional) - The coding lanuages template to be used for the export.
FileResponse- The exported file content for the project.
curl https://i18n.linkown.com/ce405725-a840-468d-a57f-0bb95cbfbcfb?file=languages.py&template=languages.py&languages=en,de,fr,az
curl https://i18n.linkown.com/ce405725-a840-468d-a57f-0bb95cbfbcfb?file=languages.json&template=languages.json&languages=en,de,fr,azPOST /{id}
Updates the project's data with the provided information.
id(path variable) - Unique identifier for the project.update_data(body) - Data containing the updates to apply to the project.
message- Confirmation message indicating the successful data update.
DELETE /{id}/key
Deletes a specific key from the project's data.
id(path variable) - Unique identifier for the project.k(query) - The key that needs to be deleted.
message- Confirmation message indicating the key has been deleted.
PUT /{id}/key
Adds a new key to the project's data.
id(path variable) - Unique identifier for the project.k(query) - The new key to add.
message- Confirmation message indicating the key has been added.
PUT /{id}/translate
Adds a translation to a specific key in the project's data.
id(path variable) - Unique identifier for the project.k(query) - The key to which the translation should be added.l(query) - The language code for the translation.v(query) - The translation value.
message- Confirmation message showing the translation key, language, value, and return status.
import requests
def test():
url = "https://i18n.linkown.com/{id}/translate"
id = "ce435725-a840-468d-a57f-0bb95cbfbcfb"
k = "APP"
l = "en"
v = f"""
v
"""
response = requests.put(url.format(id=id), params={"k": k, "l": l, "v": v})
assert response.status_code == 200
print("Test passed!",response.json())
test()GET /{id}/key
Retrieves the translation value for a specific key in a given language.
id(path variable) - Unique identifier for the project.k(query) - The key for which the translation is being requested.l(query) - The language code for the requested translation.
result- The translation value for the specified key and language.