In one of our Crowdin projects, we have the “Skip untranslated strings” option turned on and it usually works fine: translated files don’t include strings that were not translated. However, when I tried to sync our translations via the Github integration today, I saw that untranslated strings were being included as blank strings. Here’s an example commit, and here’s what that file looks like with these blank strings:
FWIW, I got in touch with Roman B. at Crowdin support and they said,
Yesterday we had a deployment in which there was a small error and it affected the update of files, our guys have already restored back everything. Tomorrow, our team will launch a special script that will go through all projects and fix files that may have been affected
So, problem isn’t solved yet but it sounds like someone’s working on it.
So each file may have different options as I prefer.
Which version of CLI do you have installed? Or this is the GitHub actions? If you don’t want to separate the files by options, probably would be better to set up 1 time everything within project settings and just keep using it.
I have the same problem! I’m using GitHub integration with an open source PHP project but “Skip untranslated strings” setting is ignored when syncing. The exported files have many empty strings.
Should this be fixed in the meantime? Or am I doing something wrong?
Files are in .php format, right? Does project settings have same options as configuration file? I mean, in both project settings + configuration file should be the same option, otherwise project settings would replace the one you’ve specified in the config file.
Also, probably it’s a 1 time diff you need to accept (at least this is what I’ve done with .mdx files).
Hello @gadgetto does this issue can be reproduced with another file format or another php file? I mean, to see if it affects only yours file from Github, can you upload the sample (not in php) just via UI of Crowdin, add 1-2 random translation and download it so see if the option of skip works?
From my side, I can see you have 2 projects, in 1 of them the export option is “skip untranslated files”, in 2 it is “skip untranslated strings”. If you speak about 1 project, it’s expected behavior.
To me it seems that your .php files are just in .php extension. By default skip strings is not applied to text documents: .docx, .pptx, .xlsx, etc., since missing texts may cause the resulting files to be unreadable. Maybe this is why that option is not working with your files? You tested in some other format?
Thanks for your hint! So I’ll activated “Skip untranslated files” setting.
I’ts very strange that this should’t work as this is the default lexicon file format of MODX CMS. The MODX CMS (Revolution) and hundreds of plugins and add-ons are translated via Crowdin. I never heard of this problem.
Are there any plans to “fix” this? Or may I ask what’s the reason this feature isn’t available for PHP files?
We use AST to import PHP files. This means that Crowdin would parse PHP code into a large object of entities, then go through the tree and catch entities that are translatable. This way Crowdin is able to translate all kinds of constructions that a client would come with, all syntax constructions that would allow storing translatable texts.
While this approach has a lot of advantages (for example, we can preserve parts of the file like comments or code that is useful but does not store translatable text) and the ability to literally support all ways of storing text that our clients would use, with this approach it is tricky to remove parts of the code.
The first thing that comes to my mind is to have a post-processor and strip lines that have empty translations. You can do this with a script:
Another way would be to use the Crowdin bundles feature. This feature would allow you to generate resource files from the list of objects Сrowdin would provide.
I can bring a tech person to consult you further on a possible development of a bundle exporter. If it is needed - please message me directly on the matter.