[gnome-shell-extensions] build: Rewrite gettext domain when exporting zips



commit 8a211f98fd9ef0adffc00fcca9e053707ed3c34f
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Aug 6 04:22:47 2021 +0200

    build: Rewrite gettext domain when exporting zips
    
    Now that every extension picks up its gettext domain from
    its metadata, we can easily change it when exporting the
    zips.
    
    That ensures that every extension only binds its own domain
    instead of messing up other extension's translations.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/issues/335
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/179>

 export-zips.sh | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/export-zips.sh b/export-zips.sh
index 2568019..3099144 100755
--- a/export-zips.sh
+++ b/export-zips.sh
@@ -20,6 +20,10 @@ for f in $extensiondir/*; do
   uuid=$name gnome-shell-extensions gcampax github com
   schema=$schemadir/org.gnome.shell.extensions.$name.gschema.xml
 
+  olddomain=gnome-shell-extensions
+  newdomain=gnome-shell-extension-$name
+  sed -i "/gettext-domain/ s:$olddomain:$newdomain:" $f/metadata.json
+
   xgettext --from-code=UTF-8 --output-dir=$builddir --output=$name.pot $f/*.js
 
   if [ -f $builddir/$name.pot ]; then


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]