Hello, currently I am working on a project whereby we are creating our own service / SDK layer for integrating to Transifex CDS (Native) via .NET, and I’ve hit one stumbling block…
No matter what form I send the string in to the CDS service, it refuses to be treated as pluralised, and I’m not quite sure where I’m going wrong, the sample string is as follows:
{file, plural, one {I have {# file} file} other {I have {# file} files}}
Which is being set against the “string” property in the JSON we are submitting. When trying to submit the above string for en_GB I get an error message saying “The plural rules of the resource_string do not match those of the project’s source language”
I am Christos , one of the support engineers in Transifex.
Let me see if i understand correctly. You are developing a new sdk to work inside .net , correct?
And you are trying to upload source plural strings. May i have the details of the project you are trying to upload to ? Is the source language of the project en-GB? You can contact us directly also at support@transifex.com
Hi @chrisb yes that is correct, we’ve got it working for the most part, but struggling to get the plurals into transifex via the CDS service. I can provide details of the project, if required, but I can confirm that the source language of the project is en_GB.
Thank you for your answer and apologies for the late response.
In order to have a full picture for our devs , could we have access to your code ,or just the part for submitting plurals , developed for this sdk for our devs to have a look and see what is missing?
@chrisb realistically, all I need is a sample payload which can be sent to the CDS which is treated as a plural string… once I have this I can then continue with integrating plurals into our sdk.
Our devs are looking into it. We have a test we would like you to try.
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token:secret" \
-d '{"data": { "plural_key": { "string": "{file, plural, one {I have {# file} file} other {I have {# file} files}}" } }}' \
https://cds.svc.transifex.net/content
Replace token: secret with your native credentials .If this works and most probably there is something wrong in your code , maybe some escaping or spacing issue.
Also , I have a question regarding the sdk you are building. Is this developed as open-source ? If not, would you be willing to open source this sdk?
Looking forward to the result of the test and your answer.
Christos
@chrisb many thanks for the sample plural string, I can confirm it’s now gone into the system successfully, and I now fully understand the format required for CDS.
In answer to your other question no it is not, and unfortunately that won’t be possible I’m afraid.