How do I add translation to custom templates in odoo 15 - report

In odoo 15 I have created a custom layout template for an invoice report (PDF). This template contains some texts in German language. Where do I have to specify any translation of these texts so they are considered if the invoice is printed in e.g. English?

Activate debug mode.
You can find it in settings > translations > Transleted terms, and you search for your germans terms for translate them one by one.
You can set your template manually, settings > Technical > Email templates
and now you can edit the template. But this is a non-dynamic solution.
More dynamic way :
Use .po,.pot files in your custom modules. if you have computed strings in your template use the function "_" before.
Ex :
my_str = _("Hello, how are you")
afterwards, edit the '.po' file
Look at the documentation here:
https://www.odoo.com/documentation/16.0/developer/howtos/translations.html
Regards,

Related

Docxtemplater - Newlines between loop iterations

TLDR - how do I use either a custom parser function or modify the loop module to it'll add a newline after each iteration?
Long story:
I'm using old templates that used to be rendered with some MS tools, now trying to render them with docxtemplater. Main requirement is to not modify the templates. Use them as they are, and be able to render documents as identical as possible to that MS tool.
Here's what a loop looks like in one of the templates:
«TableStart:MortgageInfo»« MortgageInfo_Name»
« MortgageInfo_MortgageStreet»
«CityStateZip»«TableEnd:MortgageInfo»
I used custom delimiters for « and » and created a custom loop module to handle the custom TableStart: and TableEnd: format.
There is no linebreak between «CityStateZip» and «TableEnd:MortgageInfo» so the 2nd item is rendered immediately after the 1st without a linebreak.
Anybody has any idea how I add this missing linebreak? Please bare in mind - no modification to the template is allowed...

Translation files of my plugin are not being loaded or work incorrect

I need to translate some parts of text to French.
Things I've tried so far:
I created fr.po and fr.mo files in my plugin's /languages directory. I used Poedit for this purpose. I've tried different variants like fr_FR - didn't help.
I added the following to my plugin's main file along with its name and other information:
* Text Domain: pluginname
* Domain Path: /languages
Plugin name does not contain any special characters or underscores/dashes - it's a single word.
Also, tried to use load_plugin_textdomain() function instead (or even along with) to make this work.
Also, tried to add this to my wp-config.php file:
define ('WPLANG', 'fr_FR');
Tried to use any combinations of described actions as well.
I have a string to be translated:
__('Recently', 'pluginname')
The word "Recently" is being displayed correctly but it is not being translated if I change site language. I tried both changing in WP admin panel and adding into config file (mentioned above)
I tried to use get_locale() to check if this was actually changed. This returns 'fr_FR' which is exactly the same with my .po/.mo file names.
**P.S.: ** Checked all these questions and tried all suggested solutions - didn't help:
Wordpress - Plugin translation not working
WordPress plugin translation issue
Wordpress plugins translation
Update: load_plugin_textdomain() returns false if I try to var_dump() result right after function execution.
Actually, the problem was in the names of files. Other than locale name it should also consist of the plugin name, e.g. pluginname-fr_FR.po/pluginname-fr_FR.mo for my case. Yes, this is described in the codex, I should read this more attentively :)

Customize IBM DiffMerge to export a custom Report

I am using IBM DiffMerge to generate a Report that shows all differences between two .cls files or .sbs files. I was playing with it and I saw that there is a filed in option menu that allows you to change the format of the report, but it implies some keywords, like $elemname to print the element's name or $elemtype to print its type $leftonly or $rightonly which show how many differences are in the left diagram or in the right one.
Now, I was wondering if there are more variables like those above, especially one that can print a component's GUID (unique ID in Rhapsody).
Thanks,
Daniel
I would expect that $GUID will give you what you're looking for.
Under the ReporterPlus installation folder there is a folder named Templates. In it you'll find a file named DiffReport.dpl which you can load it into ReporterPlus for editing like any other template. You must run Rep+ with a command line option so that it loads with the Diffmerge specific schema:
Reporter.exe /mode=dfm
After that you can load the Diffmerge template, and edit it to customize the output of DiffMerge reports. When you do, try adding $GUID into the output.
Regards, Simon

Custom report translation in OpenERP

Basically all the reports are changed language as per the customer language in OpenERP 7.0. But I have customized a new accounting report as same as default accounting(invoice) report.
While printing my custom report that is not translating based on customer language. Please help to solve this. I am trying this more than two days and not yet any solution.
Note: I have also used setLang function in my report.
Most probably the best solution is to add the i18n folder to your custom addon. In there you add the appropriate .po file and the trick is done.
Remember to add:
folder called i18n
In there
file module_name.pot
file language.po (example it.po)
Salam !
just make [[ setLang('code_lang*') ]] up report
example for french country fr_FR
I hop that help you

how to fetch old RSS feeds from movabletype site?

Is there any instructor for that? I mean some way to access other pages of movabletype feed?
Example:
MovableTypeSite/feed/page=10
or
MovableTypeSite/feed/rss?page=7
Assuming you are using the default static publishing scheme of Movable Type, your feeds are static files that cannot be modified through URL parameters. The feeds by default contain the last 15 entries, but you could increase this number by modifying the default "Feed - Recent Entries" template of the blog in question.
You could change <mt:Entries lastn="15"> to <mt:Entries lastn="60"> or <mt:Entries days="60"> or use any of the attributes of the Entries tag to customize your output.
It would also be possible to set up "paginated" feeds, such as a per month feed. You could start with the default feed index template referenced above and copy it into a new archive template of the type "Entry Listing".
A little-known feature of Movable Type's search is that it supports multiple templates and by default includes a feed template. In the search results URL, you can specify a page=2 argument (or whatever page). Of course, the trick is that you need a search term -- which may or may not work well for your use.
The URL: [MT Home]/mt-search.cgi?limit=20&Template=feed&search=test&page=2
Use in the template generating the feed (a number superior to the number of entries in the system), publish it, and voilà.

Resources