kontur / fontsampler-wordpress-plugin

A Wordpress plugin that let's users interactively preview and test webfonts
http://fontsampler.johannesneumeier.com
GNU General Public License v3.0
39 stars 8 forks source link

Some issues with RTL Wordpress #73

Closed shahabsiavash closed 6 years ago

shahabsiavash commented 7 years ago

Hi,

First of all I have said this before on TypeDrawers, this is a great plugin. Love it.

Secondly, I saw some minor issues that I wanted to mention here.

When your site is an RTL one, you probably install the compatible version of Wordpress which could be Persian or Arabic. For those users the plugin's admin area is English but in RTL alignment. So I wanted to propose if you like and it is possible I want to translate the plugin to Persian and then you can add that to the languages.

Also the sliders acting a little RTL and LTR at the same time :) As you can see...

untitled2

Number 1 should be on the right next to number 2. Number 3 I don't know should be on the middle or right? Number 5 should be at the end of the slider closer to number 4, I guess.

And if we could change those px 47, px 0, % 110 it would be great. Because they should be on the right and also in Persian and RTL.

But the most important thing is the Name of the fonts, I saw in the plugin that it suppose to show the names that we choose while uploading them but in my case they are all the original font names. If you look at the screen capture here you can see that I gave them Persian custom names but in the top picture you can see they all have Latin font family names.

untitled

Great day and happy spring :)

kontur commented 7 years ago

Thanks for reporting these and offering a translation of the plugin!

I will look into those issues in separate one by one, in particular testing with a RTL Wordpress installation is something I've not done so far at all.

As for the translation of the plugin itself I have to look into adding that at some point, but currently other issues are higher on the list of priorities. Once I do, I will happily consult you for a Persian translation. 👍

shahabsiavash commented 7 years ago

Hi, any update on Font name options? :)

kontur commented 7 years ago

Been away on travels for the past two weeks. Last I've worked on options to automatically extract the file's font name on upload (to see when something's not right, also). Next steps would be to allow overriding it, both for the backend and the dropdown list for the frontend. Stay tuned ;)

kontur commented 6 years ago

Note to self: For sliders pending merge in rangeslider.js https://github.com/andreruffert/rangeslider.js/issues/286

Then use https://codex.wordpress.org/Function_Reference/is_rtl

kontur commented 6 years ago

And if we could change those px 47, px 0, % 110 it would be great. Because they should be on the right and also in Persian and RTL.

@shahabsiavash Would it be "labeltext number unit" in RTL, or "number unit labeltext", ideally?

shahabsiavash commented 6 years ago

@shahabsiavash Would it be "labeltext number unit" in RTL, or "number unit labeltext", ideally? Thanks for considering this. If you look at it RTL, it should be like this. I hope it's clear. screenshots_2018-01-19-14-55-43

kontur commented 6 years ago

Yea, okay, thanks.

Is there any other text in the front end except the "Select a sample text" dropdown default? I think all other labels are editable in the backend anyway, because I though users might want to customize this anyway (i.e. beyond just translating it), so I might as well make this one editable. Of course adding translation for the defaults would be nice.

I understand there is also the A / A black and white inverting button which are script specific - I might consider those with more abstract shapes.

For the OT button and the opentype features list - should those be translatable, or is this anyway anglocentric terminology also in applications - i.e. is there even default translations for all of those?

Any other front end strings I am missing?

shahabsiavash commented 6 years ago

Sorry for the delay. Yes, I think all of them are customizable. I don't see any other one needs to be changed. The A/A thing could be done by some shapes as you said. And that's great :) I never used OT button, because it wasn't necessary for me, but yeah, I think they should be remain as default because otherwise no one can understand them, I know I couldn't if they were Persian for example :D

kontur commented 6 years ago

Great, thank you for confirming.

I've been testing to implement defaults for the slider labels that match the Wordpress installation language. These would be the default slider labels (which can still be overwritten, of course, say if the user facing site language is different from the admin language, or a different label is desired) for new installations, and also there is an option to reset the slider labels to those defaults once they were changed. I added German and Finnish translations myself, but would you be willing to translate a few strings to Persian, so we'd get better coverage and testing of those features? If yes, have a look at this file, it is pretty self explanatory - you can post it here, or email me at support@underscoretype.com

shahabsiavash commented 6 years ago

Hi, yeah sure. Of course. I have posted it here. Although I used an online PO editor. So I couldn't add a new language, but I replaced the German with Persian words. Hope it works.

If there are more please let me know. Glad to do that.

msgid "" msgstr "" "Project-Id-Version: fontsampler-de_DE.po conversion\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-01-21 11:04+0000\n" "PO-Revision-Date: 2018-01-21 11:07+0000\n" "Last-Translator: \n" "Language-Team: German (Germany)\n" "Language: de-DE\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Loco-Source-Locale: fa_IR\n" "X-Loco-Parser: loco_parse_po\n" "X-Generator: Loco https://localise.biz/"

. translators: Default label for font size slider in the front end

: FontsamplerPlugin.php:90

msgid "Size" msgstr "اندازه"

. translators: Default label for letter spacing slider in the front end

: FontsamplerPlugin.php:96

msgid "Letter spacing" msgstr "فاصله حروف"

. translators: Default label for the line height slider in the front end

: FontsamplerPlugin.php:102

msgid "Line height" msgstr "ارتفاع سطر"

. translators: Default label for the buy button in the front end

: FontsamplerPlugin.php:136

msgid "Buy" msgstr "خرید"

. translators: Default label for the specimen download button in the front end

: FontsamplerPlugin.php:142

msgid "Specimen" msgstr "نمونه‌نوشته"

: includes/interface.php:84

msgid "Select a sample text" msgstr "انتخاب یک متن نمونه"

kontur commented 6 years ago

Superb, thank you. I can add it to the correct language file myself. Would the WP language locale for these be "fa_IR" for Persian?

I'm doing a couple of more fixes to the admin interface in RTL also, but would you be able and willing to test a development version, like on a local or online TEST environment of your page to see what gives?

shahabsiavash commented 6 years ago

Yes, it's fa_IR.

Sure. just please let me know how it works and we'll do that.

kontur commented 6 years ago

Great, thanks so much! You can download a preview version of the plugin here. In your testing environment, replace the "fontsampler" folder at /wp-content/plugins/fontsampler with the one from the downloaded zip. Make sure to keep a copy of your old one (somewhere outside the plugins directory) and also backup your database, or at least the four _fontsampler database tables in it.

When you now load your site in the frontend (might need to clear your cache / hardreload) these should change:

When you load your backend, these should be changed:

Also let me know if some of your frontend theme overwrites act funny, because I changed the markup for the sliders a little bit. Still missing is the option to reset the "Select a sample text" to the locale default - new installations will get the correct locale string, but they, too, might want to overwrite that. I'll add that option still to the Settings.

Sorry for the long wait to have the last of these things implemented, I appreciate you patience!

shahabsiavash commented 6 years ago

Hi again! I have installed the preview version on localhost. I hope that's all right. And I think everything is working (thanks to you) except the OT options which were outside the box. And those px 32 should be 32 px but in the the same position they are now.

I've captured this. Please take a look and let me know if anything is missing or should be tested.

ezgif com-video-to-gif 2

kontur commented 6 years ago

Thanks for testing! The OT modal needs fixing for RTL and LTR. This, plus the option to set the "select text" string will still be added, then this can ship with the next update.

shahabsiavash commented 6 years ago

Wonderful! Thanks.

kontur commented 6 years ago

@shahabsiavash There is one unrelated change with the next release, which also introduces another text I didn't think of. Would you be able to translate for me still "Select a language" to Persian? The text is displayed in a new dropdown that lets users pick OT locl features, i.e. preview language specific substitutions.

kontur commented 6 years ago

@shahabsiavash Also, I would like to start listing (and linking to their website, if wanted) translators, starting with you. If you wish to be included in the about page like other contributors for translations please let me know what name or nick to use and if to link to some page of yours :)

shahabsiavash commented 6 years ago

Hi, "Select a language" would be: "انتخاب یک زبان".

And for the next comment, thanks for the offer. You could use my everywhere username: Si47ash and the website is shahabsiavash.com if it's ok.

Thanks again.

kontur commented 6 years ago

The 0.4.0 update is now available via the Plugin registry. Thanks again for your help with the translation and debugging this! Let me know if you find anything out of place in regard to this.