creating language pack for Brazilian Portuguese

This is the right place to report general bugs, make suggestions or ask for help.
randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

creating language pack for Brazilian Portuguese

Post by randy » Thu Feb 13, 2020 1:19 am

I want to make a language pack for Brazilian Portuguese.

I’m not so sure how to do it. Here’s what I’ve done so far.

In the directory fp-interface/lang/ I copied and pasted the directory en-us and changed the name to pt-br. In that directory, I edited the file lang.conf.php to:

Code: Select all

<?php
	
	$langconf = array();
	$langconf['id'] = 'Português (Brasil)';
	$langconf['locale'] = 'pt-br';
	$langconf['charsets'][0] = 'utf-8';
	$langconf['charsets'][1] = 'iso-8859-15';

?>
This resulted in the “Português (Brasil)” option appearing in the Language dropdown menu in the International Settings section under the “Options” option on the Admin page. I selected this option and saved.

I then edited some items in the lang.admin.main.php file. (A portion of that edited file is below.) After saving the file, I expected these translated strings to appear when I refreshed the the page but they didn’t. Obviously there’s some additional step or steps I need to do to make these translations appear. Can you tell me what else I need to do?

Code: Select all

$lang['admin']['panel']['main'] = 'Principal';
	
	$lang['admin']['main']['default'] = array(
		'head'		=> 'Bem-vindo ao painel de controle!',
		'descr'		=> 'Selecione uma ação.',

eagleman
Posts: 19
Joined: Sat Mar 02, 2019 12:10 pm

Re: creating language pack for Brazilian Portuguese

Post by eagleman » Fri Feb 14, 2020 10:55 am

You have a lot of work to do.
There are many files to translate.
All the language files into fp-interface/lang folder
All the language files into fp-plugins folder, this means every language file for every preinstalled plugin
The language file into setup/lang folder.
Probably i forgot something but it's a huge list of translations to do

randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

Re: creating language pack for Brazilian Portuguese

Post by randy » Fri Feb 14, 2020 6:14 pm

Yes, it's a lot of work, but I really want to use FlatPress and my target audience is in Brazil, so it needs to be done. I'm about 1/3 complete with the fp-interface files.

One thing I'm not sure how to translate. In the maintenance section of the Admin section, there's an option "Rebuild Index". I don't know what happens when you click on that link, so I don't know how to translate it.

What does clicking on "Rebuild Index" do?

randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

Re: creating language pack for Brazilian Portuguese

Post by randy » Fri Feb 14, 2020 9:51 pm

I may be a bit dense, but I don't see a reason to translate the setup.php file (although I just completed doing so). I don't see how to use a version of this file in any language except English since you can't change the language until it's installed. Or am I missing something? If there's a way to do the setup with a different language, I'd like to know how so I can test/debug my translation.

User avatar
Arvid
FlatPress Coder
Posts: 91
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: creating language pack for Brazilian Portuguese

Post by Arvid » Wed Apr 15, 2020 11:15 am

Randy,

thank you very much for taking that effort! Glad you want to help FlatPress spread in Brazil :)
You correctly named all the files to be translated: The copy of fp-interface/lang/en-us (in your case, to pt-br), and each plugin translation (fp-plugins/*/lang).
I could not reproduce your problem, though: Copied the English folder to pt-br, changed the files, immediatly got the result. Do you still have that behaviour? Maybe change to another language and then back to Português (Brasil)?

randy wrote:
Fri Feb 14, 2020 6:14 pm
What does clicking on "Rebuild Index" do?
It rebuilds the index ;) FlatPress maintains an index of its contents to accelerate access. Clicking on "Rebuild index" will do a backup of the current index (fp-content/index[current timestamp]) and create an new one (fp-content/index).

randy wrote:
Fri Feb 14, 2020 9:51 pm
I may be a bit dense, but I don't see a reason to translate the setup.php file (although I just completed doing so). I don't see how to use a version of this file in any language except English since you can't change the language until it's installed. Or am I missing something? If there's a way to do the setup with a different language, I'd like to know how so I can test/debug my translation.
Yap, we have an issue for that one. Goal is to have the setup asking for your preferred language at first. This will require additional translation files in each supported language. Until the code is prepared for this, the setup just remains in English.

Thank you very much for your work! Please let us know when your translation is done, I'd love to put in into the standard package!
All the best
Arvid
Helpful FlatPress links: Project blog 📝 - FlatPress wiki 📖 - FlatPress@Twitter 🐦
Stay up to date with our feeds: Forum RSS feed 📜 - Project blog RSS feed 📜


🇩🇪 Habe aktuell für meinen Arbeitgeber hier im Ruhrgebiet eine Stelle zu besetzen! 🇩🇪
- Softwareentwickler (Webanwendungen) - unbefristet, sofort

randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

Re: creating language pack for Brazilian Portuguese

Post by randy » Wed Apr 15, 2020 8:24 pm

Arvid, I hadn't received any reply for a long time, so I thought you weren't interested and tried a different CMS. Since I saw your reply, I've continued with my translation.

Well, I’ve gone about as far as I can on my translation without some help. I’ve translated the files listed below and also the plugins listed (except the ones marked with (no lang files)).

There are a few things I couldn’t figure out how to translate. As an experiment, I set the language to Deutsch and looked at these things in the German translation and they are also in English, not German, so whoever did that translation also couldn’t translate these things. Also, I couldn’t even find where they are created so I can change them, even if they aren’t going to be translated. They are:
• ***On the admin pages, in the top right corner, there are links to the home page and to logout.
• In Admin, on the Uploader page, the area to select the files to upload has “Browse” and “No file selected.”
• On the widgets page, the names (titles) of the widgets are in English.
• Also on the widgets page, the “Drop here” is in English.
• ***In the footer, there is “This blog is proudly powered by FlatPress.” only in English.
*** Never mind these items. I discovered these are theme specific to the Leggero theme and are not “translatable”.

The files and plugins below have been translated.

I have compressed the entire website into a .zip file of 5.8MB. I can send this to you to look at if you’d like.

flatpress/fp-interface/lang/pt-br/
lang.admin.config.php
lang.admin.entry.php
lang.admin.main.php
lang.admin.maintain.php
lang.admin.php
lang.admin.plugin.php
lang.admin.static.php
lang.admin.themes.php
lang.admin.uploader.php
lang.admin.widgets.php
lang.comments.php
lang.conf.php
lang.contact.php
lang.default.php

Plugins:
accessibleantispam
adminarea
akismet
archives
BBCode
blockparser
calendar
categories
favicon
footNotes (no lang files)
jquery (no lang files)
lastcomments
lastcommentsadmin
lastentries
lightbox2
mediamanager
postviews (no lang files)
prettyurls
protectedmaillinks (no lang files)
qspam
readmore
searchbox (no lang files)
thumb

User avatar
Arvid
FlatPress Coder
Posts: 91
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: creating language pack for Brazilian Portuguese

Post by Arvid » Thu Apr 16, 2020 10:27 am

Randy,
randy wrote:
Wed Apr 15, 2020 8:24 pm
I hadn't received any reply for a long time
sorry for this ...
randy wrote:
Wed Apr 15, 2020 8:24 pm
Since I saw your reply, I've continued with my translation.
...and thanks for this! :)

randy wrote:
Wed Apr 15, 2020 8:24 pm
In Admin, on the Uploader page, the area to select the files to upload has “Browse” and “No file selected.”
This is the default file upload form, its captions simply rely on your browser settings. English in your case :)
randy wrote:
Wed Apr 15, 2020 8:24 pm
On the widgets page, the names (titles) of the widgets are in English.
These are the wigdet names, they don't have a translation.
randy wrote:
Wed Apr 15, 2020 8:24 pm
Also on the widgets page, the “Drop here” is in English.
This is indeed a string that is not translated. But the solution is not trivial, I opened an issue for that.

randy wrote:
Wed Apr 15, 2020 8:24 pm
I have compressed the entire website into a .zip file of 5.8MB. I can send this to you to look at if you’d like.
That would be great. Or, even better: Can you remove every file except the pt-br ones you created? What remains is the language pack: Ready to be copied into any FlatPress instance. If you finished this, you could easily add it to the language page on the wiki. I would then also add it to the FlatPress repository, so it becomes part of the next version to be released.

Thank you very, very much for your effort!
Helpful FlatPress links: Project blog 📝 - FlatPress wiki 📖 - FlatPress@Twitter 🐦
Stay up to date with our feeds: Forum RSS feed 📜 - Project blog RSS feed 📜


🇩🇪 Habe aktuell für meinen Arbeitgeber hier im Ruhrgebiet eine Stelle zu besetzen! 🇩🇪
- Softwareentwickler (Webanwendungen) - unbefristet, sofort

randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

Re: creating language pack for Brazilian Portuguese

Post by randy » Thu Apr 16, 2020 11:44 am

"This is the default file upload form, its captions simply rely on your browser settings. English in your case."

Actually, my browser is in Portuguese, so I don't know why it is presenting these fields in English, but it's a pretty minor thing.

I'll work on making a language pack by deleting all of the non-pt-br files.

randy
Posts: 8
Joined: Thu Feb 13, 2020 12:43 am

Re: creating language pack for Brazilian Portuguese

Post by randy » Thu Apr 16, 2020 12:16 pm

Sorry, but I couldn't see how to add the language pack to the language page on the wiki. I have attached it here. Perhaps you can add it to the wiki.
Attachments
flatpress-pt-br-lang-pack.zip
Language pack for Brazilian Portuguese.
(34.42 KiB) Downloaded 20 times

User avatar
Arvid
FlatPress Coder
Posts: 91
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: creating language pack for Brazilian Portuguese

Post by Arvid » Fri Apr 17, 2020 10:23 am

Awesome, thank you very much! I added it to the wiki and to the FP code as well. (I put you onto the FP contributors list, let me know if I should add a certain link to your name.)

Editing the wiki is quite easy, by the way. Simply register an account; once logged in, you can edit the contents. Our wiki lives by the community's contributions! :)

All the best,
Arvid
Helpful FlatPress links: Project blog 📝 - FlatPress wiki 📖 - FlatPress@Twitter 🐦
Stay up to date with our feeds: Forum RSS feed 📜 - Project blog RSS feed 📜


🇩🇪 Habe aktuell für meinen Arbeitgeber hier im Ruhrgebiet eine Stelle zu besetzen! 🇩🇪
- Softwareentwickler (Webanwendungen) - unbefristet, sofort

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests