Coder Social home page Coder Social logo

Comments (17)

maennchen avatar maennchen commented on June 14, 2024 2

@whatyouhide Oh, oops. I overlooked the @moduledoc false.

Easy fix then :)

from gettext.

maennchen avatar maennchen commented on June 14, 2024 1

@whatyouhide I just got a big task in and not much time until the deadline. I can have a look next week the earliest as well.

from gettext.

maennchen avatar maennchen commented on June 14, 2024 1

I had a look at the issue and I think this is working as intended:

  • mix gettext.merge merges .pot => .po
  • mix gettext.extract --merge does the extraction and only applies the merge for the files that changed in the extraction

from gettext.

maennchen avatar maennchen commented on June 14, 2024 1

@whatyouhide I‘m also a bit busy at the moment. So I wasn’t planning to soon.

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen heyo, you have any time to look at this by any chance? This week I won't, but I might do a cycle on Gettext next week if you're busy 🙃

from gettext.

saveman71 avatar saveman71 commented on June 14, 2024

Thank you for investigating the issue. So I assume we can't do anything about the above scenario? If so we can close the issue

from gettext.

maennchen avatar maennchen commented on June 14, 2024

We could change the behavior to always merge even if the .pot is unchanged. I'm not sure though if we should.
What do you think @whatyouhide?

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen yeah that's an easy way out and worth a try I think 👍

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen are you going to work on this by any chance?

from gettext.

maennchen avatar maennchen commented on June 14, 2024

@whatyouhide I looked quickly how this could be implemented.

Currently we remove unchanged files from the list in Extractor.pot_files/2:

|> Enum.reject(&match?({_, {_, :unchanged}}, &1))

The gettext.extract task does not take the priv directory path as gettext.merge does.

In conclusion I think we either have to change the Extractor.pot_files/2 function (add option to include unchanged or a breaking change) or we have to take extra arguments for the gettext.extract mix task.

How would you want to implement this?

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen what would the extra arguments for the gettext.extract task be?

from gettext.

maennchen avatar maennchen commented on June 14, 2024

@whatyouhide The path to the .pot files as in gettext.merge.

But this feels quite hacky since theoretically gettext.extract could extract for multiple Gettext modules and could therefore have multiple paths.

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

I re-read this issue all over again to regain context. What we're doing right now makes sense to me, because extract is about extraction and not merging. I think if you run mix gettext.merge, then we still update the .po file that was changed.

However, I think the intent of mix gettext.extract --merge was to essentially mimic gettext.extract + gettext.merge. In that case, we'll want mix gettext.extract --merge to also override the .po files, even if the POT files were unchanged. Wdyt?

from gettext.

maennchen avatar maennchen commented on June 14, 2024

@whatyouhide That is correct.

It would be trivial to implement if Extractor.pot_files/2 would return [{"path1.pot", :changed, "contents..."}, {"path2.pot", :unchanged, "contents..."}] instead of just [{"path1.pot", "contents..."}].

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen Extractor.pot_files/2 is not public, so we can change it to return [{path, :changed, contents}, ...] right?

from gettext.

whatyouhide avatar whatyouhide commented on June 14, 2024

@maennchen I'd like to release 1.0 around the end of the year/start of new year, so let's not release a new version with this change and let's wait for 1.0 direclty.

from gettext.

maennchen avatar maennchen commented on June 14, 2024

@whatyouhide I think it would make sense to tackle the umbrella issue before releasing a 1.0 eince that could potentially create larger problems / changes.

from gettext.

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.