Git Product home page Git Product logo

Comments (3)

liamnichols avatar liamnichols commented on July 3, 2024

Thanks for reporting this! This is an interesting issue 🤔 It seems that Xcode will consider a string with a missing extractionState as automatically managed:

Screenshot 2024-03-28 at 13 04 45

The reason that we skip/warn about Automatically managed strings is that there is potential for Xcode to see the generated definition try to update the source in the Strings Catalogs (essentially overwriting what you have defined) which is something that we want to avoid.

Before going down the route of overriding this, could you confirm if you have spoken with your translation platform about this? I would expect that the value should be either preserved from upload, or set to manual if your generating a Strings Catalog from phrases that are defined in the platform directly.

As a temporary workaround, you could use jq to post-process the file after downloading:

jq --indent 2 '.strings |= map_values(if has("extractionState") then . else {"extractionState": "manual"} + . end)' Localizable.xcstrings > Localizable.xcstrings.tmp && mv Localizable.xcstrings.tmp Localizable.xcstrings

from xcstrings-tool.

VadimPavlov avatar VadimPavlov commented on July 3, 2024

Thanks for workaround.
I have already contacted team of online tool, to set this field to manual or provide option to configure it.

However, there might be others edge cases with this field.
I believe this should be an easy fix on tool side. For example some static variable (array?) with StringExtractionState value to ignore/warning probably?

from xcstrings-tool.

liamnichols avatar liamnichols commented on July 3, 2024

It's relatively easy to add configuration options to the CLI, but there isn't really a good way to pass flags through when using the Package Plugin (I don't encourage the usage of the CLI directly atm).

I'm interested to see which other scenarios where the extractionState is set to something other than manual or automatic to understand if the customisation would be the appropriate way to handle it or not

from xcstrings-tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.