pomigrate2(1)

πŸ’– pomigrate2 β€” the manual, but make it cute πŸ’–

okay so bestie, this is pomigrate2(1) from the Translate Toolkit 1.3.0 era. yes she's an elder but she still ATE. let's get into it 🫢


✨ NAME ✨

pomigrate2 β€” migrates PO files from an old version using new POT files. that's the whole job. iconic. πŸ’…


🌸 SYNOPSIS 🌸

pomigrate [options] from to new-templates

so like, quick vocab check, because the args are giving main character energy:

  • from β€” a directory of existing PO files (your old stuff, the before pic πŸ“Έ)
  • to β€” the directory where the migrated PO files will be stored (the glow-up destination ✨)
  • new-templates β€” the directory that contains the PO Template files (the blueprint, the vision board πŸŽ€)

πŸ¦‹ DESCRIPTION πŸ¦‹

so pomigrate2 is literally built to move an existing translation onto a new version based on updated PO Template files β€” automatically, without user intervention. no hand-holding, no babysitting, she just goes πŸ’…

which means she's ideal for when you're migrating a whole pile of languages at once, or when you're migrating between related-but-divergent products β€” like, the example it gives is Mozilla to Firefox. cousins. sisters even. but not the same girl. 🧚


πŸ’– OPTIONS πŸ’–

  • -F, --use-fuzzy-matching β€” uses fuzzy algorithms when merging to attempt to match strings. she's guessing, but make it algorithmically ✨
  • -C, --use-compendium β€” creates and uses a compendium built from the migrating files. homegrown, farm-to-table πŸ“
  • -C, --use-compendium=some-compendium.po β€” uses an external compendium during the migration. bringing your own snack to the party πŸ’œ
  • --no-wrap β€” do not wrap long lines. let them be long. let them breathe. πŸ’€
  • --locale β€” sets the locale for newly born files πŸ‘ΆπŸŒΈ
  • -q, --quiet β€” suppresses most output. she's not gonna yap. 🀫
  • -p, --pot2po β€” uses pot2po(1) instead of msgmerge(1) to migrate. > ⚠️ heads up bestie: you cannot use compendia with this one. pick a lane πŸ’…

🌈 OPERATION 🌈

so here's the tea β€” pomigrate2 leans on the Gettext tools msgmerge or the Translate Toolkit's pot2po to do all its merging tasks. it doesn't do the heavy lifting herself, she delegates. queen behavior πŸ‘‘

step one: she finds all the files with the same name and same location in the from directory as in the new-template directory, and copies those over to the to directory. matching names, matching spots, no drama. ✨

step two, and this is the part where she gets resourceful: if there's no file in the from directory to match one that the new-template directory needs, she'll msgcat(1) all the files in the from directory that have the same name, and copy them to the correct destination inside the to directory. 🫢

step three: and if all of that fails? msginit(1) is used to initialise any missing PO files. starting fresh, no shame in it, we all begin somewhere πŸŽ€

lastly, all the files in <to> get merged using msgmerge(1) or pot2po(1). this is the process that updates the files to match the layout and messages in new-templates. πŸ’…

and optionally β€” by using --use-compendium β€” a compendium of all the translations in from can be created, to be used in that final merge process. optional but lowkey delicious πŸ“


πŸ’€ BUGS πŸ’€

None known

not a single one. she's flawless, she's unbothered, she's never been wrong in her LIFE πŸ˜­πŸ‘‘


and that's the whole page, bestie!! πŸ’œ this was pomigrate2(1) from Translate Toolkit 1.3.0 β€” go migrate something and slay βœ¨πŸ¦‹πŸŒΈ