syntax = "proto3";

package com.wixpress.vi.localization.translator;

import "google/protobuf/wrappers.proto";
import "wix/api/validations.proto";
import "wix/api/entity.proto";

/*
A piece of content contains many strings, and usually comes if the form of a JSON/HTML/properties file.
Consider the following JSON:
```
{
"key": "A sentence to translate",
"key-2": "Another sentence to translate"
}
```
The values of the JSON are the actual content that needs translation. The keys are identifiers for each translatable.
*/

/*
 A human readable value of your choice, that uniquely identifies the uploaded content (e.g file path or URL).
 We recommend that you use file path and file name, similar to how version control systems identify the file.
 This must be a contentUri that does not exist in the current Smartling project.
*/
message Content {
    option (wix.api.entity) = {
      fqdn: "wix.localization.translator.v1.content"
      segment: USERS
    };
    string content_uri = 1;

    // The content's language (default = English)
    google.protobuf.StringValue locale = 2 [(wix.api.readOnly) = true];

    /*
     Actual text this content represents.
     The text can contain multiple strings and usually comes in the form of a file, i.e json or html.
    */
    Text text = 3;

    // Indicates if the text is fully translated in this locale
    google.protobuf.BoolValue isFullyLocalized = 4 [(wix.api.readOnly) = true];
}

message SourceContent {
    /*
     A human readable value of your choice, that uniquely identifies the uploaded content (e.g file path or URL).
     We recommend that you use file path and file name, similar to how version control systems identify the file.
     This must be a contentUri that does not exist in the current Smartling project.
    */
    string content_uri = 1;
    /*
     Actual text this content represents.
     The text can contain multiple strings and usually comes in the form of a file, i.e json or html.
    */
    Text text = 2;
}

message Text {
    // json | html
    string content = 1;

    // Default = JSON
    Format format = 2;
}

message Format {
    enum FormatType {
        JSON = 0;
        HTML = 1;
        PROPERTIES = 2;
        PLAIN = 3;
    }

    FormatType format_type = 1;
}

message Directives {
    enum DirectivesType {
        DEFAULT = 0;
        ICU = 1;
    }

    DirectivesType directives_type = 1;
}

/*
 Provide a unique Smartling project that belongs only to you.
 If you don't have one please refer to Localization team in order to help with it's creation.
*/
message ClientConfig {
    option (wix.api.entity) = {
      fqdn: "wix.localization.translator.v1.config"
      segment: USERS
    };
    string smartling_project_id = 1;
}
