Skip to content

Commit

Permalink
internationalization changes (I hope they're right, can't find any do…
Browse files Browse the repository at this point in the history
…cs on doing this with GIMP plugins), updated README
  • Loading branch information
SeanHayes committed Dec 1, 2010
1 parent a2a8937 commit 0e39344
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
12 changes: 12 additions & 0 deletions README
Expand Up @@ -2,6 +2,18 @@

This is a Python plug-in for the GIMP that will extract images and text out of a .psd file (or other layered formats) and create an .html template from it. I don't think this plugin will ever fully replace a human coder, but it should be able to do 50-90% of the work.

== Important URLs ==
Project Repository:
https://github.com/SeanHayes/psd2html-gimp-plug-in
Download Page:
https://github.com/SeanHayes/psd2html-gimp-plug-in/archives/master
GIMP Plugin Registry Page:
http://registry.gimp.org/node/24767

== Download ==
Go to: https://github.com/SeanHayes/psd2html-gimp-plug-in/archives/master
Right Click on psd2html.py and save to your computer.

== Installation ==
This plugin has only been tested on Linux, but in theory it should work on Windows as well. If not let me know.

Expand Down
22 changes: 12 additions & 10 deletions psd2html.py
Expand Up @@ -29,14 +29,16 @@
handler.setLevel(logging.DEBUG)
logger.addHandler(handler)

gettext.install("gimp20-python", gimp.locale_directory, unicode=True)
gettext_domain = "gimp20-python"
gettext.install(gettext_domain, gimp.locale_directory, unicode=True)

justifications = ('left', 'right', 'center', 'justify')

opacity_template = """
opacity: %.1f;
filter: alpha(opacity=%i);"""

#TODO: add relative positioning option
css_image_template = """#%(id)s
{
background-image: url("%(url)s");
Expand Down Expand Up @@ -334,26 +336,26 @@ def plugin_func(image, drawable, css_opacity, extract_text_images, export_images

register(
"psd2html",
_("Converts a .psd file (or other layered image) to an .html template."),
_("This is a Python plug-in for the GIMP that will extract images and text out of a .psd file (or other layered image) and create an .html template from it. I don't think this plugin will ever fully replace a human coder, but it should be able to do 50-90% of the work."),
N_("Converts a .psd file (or other layered image) to an .html template."),
N_("This is a Python plug-in for the GIMP that will extract images and text out of a .psd file (or other layered image) and create an .html template from it. I don't think this plugin will ever fully replace a human coder, but it should be able to do 50-90% of the work."),
"Seán Hayes",
"Seán Hayes",
"2010",
N_("_Convert to HTML..."),
"*",
[
(PF_IMAGE, "image", "Input image", None),
(PF_DRAWABLE, "drawable", "Input drawable", None),
(PF_TOGGLE, "css-opacity", "Whether to use CSS to specify opacity (1, True) or save it in the image file (0, False).", True),
(PF_TOGGLE, "extract-text-images", "Extract images for text layers. Off by default, but you may want to turn this on if you have text in a special font that users aren't likely to have.", False),
#TODO: add option for interactive file saving, and another for css defined opacity
(PF_IMAGE, "image", _("Input image"), None),
(PF_DRAWABLE, "drawable", _("Input drawable"), None),
(PF_TOGGLE, "css-opacity", _("Whether to use CSS to specify opacity (1, True) or save it in the image file (0, False)."), True),
(PF_TOGGLE, "extract-text-images", _("Extract images for text layers. Off by default, but you may want to turn this on if you have text in a special font that users aren't likely to have."), False),
#TODO: add option for interactive file saving
#to do later: add options for manually choosing CSS and JS to use, could be useful for compatibility with CSS and JS frameworks
],
[],
plugin_func,
menu="<Image>/Filters/Web",
domain=("gimp20-python", gimp.locale_directory),
)
domain=(gettext_domain, gimp.locale_directory),
)

main()

0 comments on commit 0e39344

Please sign in to comment.