Quoting Emil Velikov (2018-09-03 07:18:31)
> On 24 August 2018 at 19:45, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Emil Velikov (2018-08-24 08:57:29)
> >> On Fri, 24 Aug 2018 at 15:16, Dylan Baker <dy...@pnwbakers.com> wrote:
> >> >
> >> > Meson won't put the .gmo files in the layout that python's
> >> > gettext.translation() expects, so we need to handle them differently,
> >> > this switch allows the script to load the files as meson lays them out
> >>
> >> No obvious reason comes to mind why we want divergence here.
> >> Can you elaborate more what's happening here - what are the .gmo
> >> files, I though we're using .mo ones?
> >
> > Meson uses .gmo to distinguish that they are specifics GNU mo files, as 
> > opposed
> > to one of the other flaovrs like the solaris mo files, which use a 
> > completely
> > different syntax. The real difference is that autotools generates a folder
> > hierarchy to place the .mo (or .gmo) files in, but meson doesn't guarantee
> > folder structures in the build directory, so mimicking the autotools 
> > behavior
> > isn't guaranteed to work or continue working.
> >
> >>
> >> If the only difference is a) extension and b) .mo file location - we
> >> could update the autoconf/others to follow the same pattern.
> >
> > We certainly could change autotools to follow the same pattern if that's 
> > what
> > you wanted to do. I just don't have the expertise with autotools to do it
> > quickly, and I wanted to get something wired for meson.
> >
> Off the top of my head, the following should work pretty much
> everywhere - android/autoconf/scons(?)

I know for certain scons doesn't use translations, so that's fine. I'm fairly
doubtful android does (and if they do they probably shouldn't) since this is
only for drirc description translations.

I'm just checking email today (It's a US holiday, but my dog woke me up at 6 and
I'm bored). But I'll apply this patch tomorrow and see about dropping the
--meson option.

Dylan

> 
> s/\/LC_MESSAGES\/options// -- change $lang/LC_MESSAGES/options.mo -> $lang.mo
> s/\<mo\>/gmo/;s/\<MOS\>/GMOS/ -- change .mo -> .gmo
> s/$$lang\/LC_MESSAGES/$(@D)/ -- change $lang/LD_MESSAGES -> current_builddir
> 
> Autoconf patch - formatting may be off:
> 
>  LANGS=$(POS:%.po=%)
> -MOS=$(POS:%.po=%/LC_MESSAGES/options.mo)
> +GMOS=$(POS:%.po=%.gmo)
>  POT=xmlpool.pot
> 
> -.PHONY: all clean pot po mo
> +.PHONY: all clean pot po gmo
> 
>  EXTRA_DIST = \
>   gen_xmlpool.py \
>   options.h \
>   t_options.h \
>   $(POS) \
> - $(MOS) \
> + $(GMOS) \
>   SConscript \
>   meson.build
> 
> @@ -65,19 +65,19 @@ BUILT_SOURCES = options.h
>  CLEANFILES = \
>   options.h
>   $(POS) \
> - $(MOS)
> + $(GMOS)
> 
>  # Default target options.h
>  LOCALEDIR := .
>  options.h: t_options.h $(GMOS)
>   $(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(srcdir)/gen_xmlpool.py
> $(srcdir)/t_options.h $(LOCALEDIR) $(LANGS) > options.h
> 
> -# Update .mo files from the corresponding .po files.
> -%/LC_MESSAGES/options.mo: %.po
> - @mo="$@"; \
> - lang=$${mo%%/*}; \
> +# Update .gmo files from the corresponding .po files.
> +%.gmo: %.po
> + @gmo="$@"; \
> + lang=$${gmo%%/*}; \
>   echo "Updating ($$lang) $@ from $?."; \
> - $(MKDIR_P) $$lang/LC_MESSAGES; \
> + $(MKDIR_P) $(@D); \
>   msgfmt -o $@ $?
> 
>  # Use this target to create or update .po files with new messages in

Attachment: signature.asc
Description: signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to