Skip to content

glob support #78

Closed
Closed

Description

@benmonro

would be nice if we could pass in a glob to the update script (or any of them that require the src dir).

for example:
ttag update i18n/*.po src/**/!(__tests__)/*.js to have it extract from every js file (not located in a __tests__ directory and then have it update every language.

is this already possible? couldn't find a way to have it exclude test files etc.

Activity

  1. AlexMost commented on Jul 30, 2019

    @AlexMost
    Member

    Hi @benmonro! Have not tried the exclude case. Agree that we should support it. Will try to investigate and report about the results here.

  2. oscar-b commented on Sep 3, 2019

    @oscar-b

    This is something I ran into as well. Would want to extract strings into separate .po files, being able to exclude a directory would solve it perfectly!

  3. benmonro commented on Sep 3, 2019

    @benmonro
    Author

    @AlexMost any update on this?

  4. AlexMost commented on Sep 4, 2019

    @AlexMost
    Member

    Hi @benmonro and @oscar-b. Haven't chance to look at it, but will try to find some time for this on this week.

  5. oscar-b commented on Oct 17, 2019

    @oscar-b

    @AlexMost Sorry to be a pita, but any progress? :)

  6. dimaqq commented on Jul 17, 2020

    @dimaqq
    Contributor

    Hi all, I wonder if anyone figured out a workaround...
    I've been using ttag for over a year now in a nested project:

    package.json
    node_modules/
    src/
    src/Foo.js  // ← want to get translations from files like this
    src/__scripts__/deploy/
    src/__scripts__/deploy/package.json
    src/__scripts__/deploy/src/index.js
    src/__scripts__/deploy/node_modules/
    src/__scripts__/deploy/node_modules/xmlbuilder/typings/index.d.ts  // ← now breaks `ttag update`
    

    This set up used to work for a long while.
    Recently, specifically ttag update got broken with a cryptic-ish error:

    src/__scripts__/deploy/index.jsSyntaxError: /global-path-to/src/__scripts__/deploy/node_modules/xmlbuilder/typings/index.d.ts: `export =` is not supported by @babel/plugin-transform-typescript
    Please consider using `export <value>;`.
       5 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
       6 |
    >  7 | export = xmlbuilder;
         | ^^^^^^^^^^^^^^^^^^^^
    

    Thus, I wonder, is there a way to tell tta-cli to ignore some submodule?

    Also, if what I'm doing is clearly a bad idea, please tell why :D

  7. aperkaz commented on Jan 2, 2026

    @aperkaz
    Contributor

    Is this request open to contributions?
    We need it in one of our (monorepo) projects, and I am happy to contribute 🙂

  8. dimaqq commented on Jan 2, 2026

    @dimaqq
    Contributor

    PRs are most welcome.
    My 2c: solutioning, that is figuring out the path forward that feels right in the ecosystem, which may not be the original request, is welcome too.

  9. aperkaz commented on Jan 6, 2026

    @aperkaz
    Contributor

    @dimaqq I got a PR up and running with an implementation proposal.
    Let me know what you think; I am very keen on adding this capability into the library 🙂

  10. aperkaz commented on May 28, 2026

    @aperkaz
    Contributor

    @dimaqq I think this issue can be closed, as it is part of ttag-cli@1.12.0

  11. dimaqq commented on May 28, 2026

    @dimaqq
    Contributor

    thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions