Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with incomplete translation into Polish. #82

Open
MareroQ-MrQ opened this issue Nov 29, 2019 · 4 comments
Open

Problem with incomplete translation into Polish. #82

MareroQ-MrQ opened this issue Nov 29, 2019 · 4 comments

Comments

@MareroQ-MrQ
Copy link

I translated your great plugin into Polish.
I'm using Gimp 2.10.14 (from gimp.org) on Win10 64bit and the latest version of Export layers.
Unfortunately, there is a problem with incomplete translation.
For comparison, I checked the French translation - the problem is identical (the same phrases are not translated - although they are included in the * .po and * .mo files).
What could be the reason for the problem?
Example translation fr_FR
locale pl_PL.zip

@MareroQ-MrQ
Copy link
Author

MareroQ-MrQ commented Dec 1, 2019

Maybe it will help (after a few attempts);
with the earlier version (but also version number 3.3.1) the translation works correctly.
Working export_layers.py code for translation:


#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Export Layers - GIMP plug-in that exports layers as separate images
#
# Copyright (C) 2013-2019 khalim19 <khalim19@gmail.com>
#
# Export Layers is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Export Layers is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Export Layers.  If not, see <https://www.gnu.org/licenses/>.

from __future__ import absolute_import, division, print_function, unicode_literals

import inspect
import os
import sys


if os.name == "nt":
  current_module_dirpath = os.path.dirname(inspect.getfile(inspect.currentframe()))
  if current_module_dirpath not in sys.path:
    sys.path.append(current_module_dirpath)


os.environ["LIBOVERLAY_SCROLLBAR"] = "0"

from export_layers import pygimplib as pg
from future.builtins import *

import gimpenums

from export_layers import exportlayers
from export_layers import settings_plugin
from export_layers import update
from export_layers.gui import main as gui_main


SETTINGS = settings_plugin.create_settings()


@pg.procedure(
  blurb=_("Export layers as separate images"),
  author="{} <{}>".format(pg.config.AUTHOR_NAME, pg.config.AUTHOR_CONTACT),
  copyright_notice=pg.config.AUTHOR_NAME,
  date=pg.config.COPYRIGHT_YEARS,
  menu_name=_("E_xport Layers..."),
  menu_path="<Image>/File/Export",
  parameters=[SETTINGS["special"], SETTINGS["main"]]
)
def plug_in_export_layers(run_mode, image, *args):
  SETTINGS["special/run_mode"].set_value(run_mode)
  SETTINGS["special/image"].set_value(image)
  
  layer_tree = pg.itemtree.LayerTree(image, name=pg.config.SOURCE_NAME, is_filtered=True)
  _setup_settings_additional(SETTINGS, layer_tree)
  
  status = update.update(SETTINGS, run_mode == gimpenums.RUN_INTERACTIVE)
  if status == update.ABORT:
    return
  
  if run_mode == gimpenums.RUN_INTERACTIVE:
    _run_export_layers_interactive(layer_tree)
  elif run_mode == gimpenums.RUN_WITH_LAST_VALS:
    _run_with_last_vals(layer_tree)
  else:
    _run_noninteractive(layer_tree, args)


@pg.procedure(
  blurb=_('Run "{}" with the last values specified').format(pg.config.PLUGIN_TITLE),
  description=_(
    "If the plug-in is run for the first time (i.e. no last values exist), "
    "default values will be used."),
  author="{} <{}>".format(pg.config.AUTHOR_NAME, pg.config.AUTHOR_CONTACT),
  copyright_notice=pg.config.AUTHOR_NAME,
  date=pg.config.COPYRIGHT_YEARS,
  menu_name=_("E_xport Layers (repeat)"),
  menu_path="<Image>/File/Export",
  parameters=[SETTINGS["special"]]
)
def plug_in_export_layers_repeat(run_mode, image):
  layer_tree = pg.itemtree.LayerTree(image, name=pg.config.SOURCE_NAME, is_filtered=True)
  _setup_settings_additional(SETTINGS, layer_tree)
  
  status = update.update(SETTINGS, run_mode == gimpenums.RUN_INTERACTIVE)
  if status == update.ABORT:
    return
  
  if run_mode == gimpenums.RUN_INTERACTIVE:
    SETTINGS["special/first_plugin_run"].load()
    if SETTINGS["special/first_plugin_run"].value:
      _run_export_layers_interactive(layer_tree)
    else:
      _run_export_layers_repeat_interactive(layer_tree)
  else:
    _run_with_last_vals(layer_tree)


def _setup_settings_additional(settings, layer_tree):
  settings_plugin.setup_image_ids_and_filepaths_settings(
    settings["main/selected_layers"],
    settings["main/selected_layers_persistent"],
    settings_plugin.convert_set_of_layer_ids_to_names, [layer_tree],
    settings_plugin.convert_set_of_layer_names_to_ids, [layer_tree])


def _run_noninteractive(layer_tree, args):
  main_settings = [
    setting for setting in SETTINGS["main"].walk()
    if setting.can_be_registered_to_pdb()]
  
  for setting, arg in zip(main_settings, pg.setting.iter_args(args, main_settings)):
    setting.set_value(arg)
  
  _run_plugin_noninteractive(gimpenums.RUN_NONINTERACTIVE, layer_tree)


def _run_with_last_vals(layer_tree):
  SETTINGS["main"].load()
  
  _run_plugin_noninteractive(gimpenums.RUN_WITH_LAST_VALS, layer_tree)


def _run_export_layers_interactive(layer_tree):
  gui_main.ExportLayersDialog(layer_tree, SETTINGS)


def _run_export_layers_repeat_interactive(layer_tree):
  gui_main.ExportLayersRepeatDialog(layer_tree, SETTINGS)


def _run_plugin_noninteractive(run_mode, layer_tree):
  layer_exporter = exportlayers.LayerExporter(
    run_mode, layer_tree.image, SETTINGS["main"])
  
  try:
    layer_exporter.export(layer_tree=layer_tree)
  except exportlayers.ExportLayersCancelError:
    pass


if __name__ == "__main__":
  pg.main()

@khalim19
Copy link
Collaborator

khalim19 commented Dec 30, 2019

Thank you for translating the plug-in into Polish. May I add it to the plug-in?

As for the French translation, it appears to be out of date - the translation is fully working for the version 2.5. Since 3.0, I vastly overhauled the plug-in UI and consequently modified quite a lot of strings. The location of many strings also changed as I moved files around (which is why, as you noticed, some identical strings are displayed untranslated).

@MareroQ-MrQ
Copy link
Author

I used the latest file to translate gimp-plugin-export-layers.pot (3.3.1)
I can only repeat: with the latest version of Export Layers it works only partially - and most oddly with the older version - perfectly.

@kamilburda
Copy link
Owner

kamilburda commented Aug 6, 2023

I was able make the attached Polish translation work by updating the .po file with the latest .pot file from the 4.0 release. The procedure names are now displayed in Polish, except for those that were updated or added after 3.3.1.

pl_PL.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants