Translation pulls from Transifex | How often? | + issue with custom labels not showing up in PDFs

Hello,

I made a few contributions to fix/update the Canadian French translation on Transifex for the past few weeks and I have been through a few app updates already (I tried both the app auto update, the source code zip and the invoiceninja.zip “full update”), but I notice that the new translations haven’t been pulled yet, or so it seems. How often is this supposed to happen?

Also, is there a quick way to test a translation on my server? I read that the admin interface must be rebuilt every time the language files are updated, but if there is any other way to eventually load the translations locally that would help a lot, as many strings are context-sensitive and some words appear quite a few times in the language file with no clear indication of which one is used where, so a lot of updating/testing would be required to ensure an accurate translation. For Wordpress I use a plugin ( Loco Translate – WordPress plugin | WordPress.org) that overwrites translated strings in real time without touching the source; this is a very fast and convenient way to translate, and even more importantly, to test translations. I wondered if something similar would be possible with Laravel/IN.

As an example, a previous user translated “State” (EN) to “Province” (FR), which would make sense on paper by reading the words listed in Transifex columns… only “State” in this case was used in the sense of “Status”. So now everytime I list my projects in Table Mode, I see a “Province” column, which makes no sense and is a bit of an eyesore - there are several examples like this. For now I am using Invoice Ninja personally while I build my database with clients/jobs etc, so I know myself what is wrong and what is waiting to get fixed, but eventually it’s going to go live for clients (I hope sooner than later) and I would expect the translation to look professional. I updated this particular string a while ago, but I can’t test it yet as I can’t get it to update, and it makes the rest of the translation exercise a bit less encouraging.

As for the rest of the 4K+ strings, I can’t go through it all without doing it thorough testing one small batch at a time, so if the language pulls would happen faster (unless I am missing something), or even better, if there was a way to dynamically translate the interfaces, that would be awesome.

Thanks in advance.

Hi,

Are you referring to translations in the admin portal or the invoice PDF/client portal?

You can customize the later using Settings > Localization > Custom Labels

Hi @hillel,

Yes, I’m talking about the admin and the dlient portal! So how often should I expect the translations be pulled from Transifex? :slight_smile:

Otherwise I am already using custom labels for invoices, great feature btw, even though it’s a bit counter intuitive to have to resave design layouts after changing the labels (as noted here Custom labels not working for groups - v5 Self-hosted - Discourse (invoiceninja.com)).

About that, there is something else regarding custom labels: although language strings update properly on the layout after resaving after editing custom labels

image

They do not update on an invoice draft using the same layout; I have updated the draft and resaved it.

image

I tried creating a new draft and nope, custom labels do not get loaded:

image

Any ideas?

Hi,

We don’t update on a set schedule, maybe every few months.

@ben any thoughts on the issue with custom labels?

I understand, but it makes it really hard to focus on translating properly if the results happen several months down the line :frowning:

Is there a way to make custom labels work on the admin portal too, then? That would be great to quickly test translations for usability/elegance/display issues (overflow, etc.).

Actually, as I understand it, it seems that pretty much every text string is a “label” under the hood, according to texts.php:

invoiceninja/texts.php at master · invoiceninja/invoiceninja (github.com)

I tried to edit some labels not related to invoices/quotes in the Custom Labels editor and it did not reflect on the interface, however. May that be linked to my other custom label issue (not showing up in the PDFs but showing in the templates), or is this just not supported (yet) ?

@ben any thoughts on the issue with custom labels?

If that may help, there is another user having what it seems to be the same problem at the moment:

Custom Label Not Complete - v5 Self-hosted - Discourse (invoiceninja.com)

This is also related to the issue there (in v5.0.50-C38) :

Custom labels work in Invoice Design preview, but not in actual invoices - v5 Self-hosted - Discourse (invoiceninja.com)

This thread too seems to describe a similar problem with custom labels not getting fetched on the actual invoices:

Wrong string translation in French Canadian - v5 Self-hosted - Discourse (invoiceninja.com)

This person here ( Custom labels not working for groups - v5 Self-hosted - Discourse (invoiceninja.com)) also had a problem with custom labels and the “solution” (more like a workaround) was to create a new template after every modification of the labels…

Finally it seems to work :slight_smile: - I was using my own invoice template across all groups, and generating a new custom template seems to take into account the custom labels.

It seems that custom labels are not updated when generating a new PDF, if the template predates the custom labels. I would suggest an improvement, because I do not think it could be a desired behavior.

I haven’t been able to reproduce the issues on the hosted demo for some reason, but since others are having very similar problems, I think there may be a bug somewhere. I’ll gladly provide any info you might need for looking further into that. Thanks!

I have checked in some fixes for the custom labels not consistently showing. This should be available in .70

1 Like

Hi @david ,

I just updated to .70 and my custom labels still do not show up on actual invoices, although they work fine on templates. Basically, it’s the same as before. I tried php artisan optimize, flushing cache, etc…

Edit: a custom field I created for products (a dropdown list) does show up on my invoices, so they are actually fetching some custom data, just not all of it. If that helps.

Hi Charles,

If you edit the invoice - save and then view the invoice. do the translation appear?

Hi @david,

No, unfortunately saving and refreshing the invoice (and any test invoice I have available actually) does not make the custom labels appear.

I also tried creating a new test invoice just now, and it still has the issue.

I even tried reverting back to one of the default designs, like “Plain”, and it doesn’t work in actual invoices, just in the template editor. So custom labels do work for PDF generation (and they work in the HTML preview too), they are just not loaded when creating/updating “real” invoices.

@charles

Are you taking about in the UI of the admin panel?

Just to add some feedback, it is still not working for me, but I let it go for the moment.

At some point, as you say, I found a workaround, but then it stopped working. I cannot reproduce the problem on the hosted demo either, but I thought I was the only one, so it could have been a server issue.

Hi @david, yes and no, I’m not sure what part of my inquiries you refer to, because actually there were three issues at hand in this thread. I’ll try to not make it not too confusing, here it goes:

  1. I was wondering how often the Transifex translations were integrated into the IN builds, since one one hand it’s hard to translate strings “bindly”, and on the other hand it’s not very motivating to work on a project (translating/reviewing thousands of strings) without having some kind of gratification, i.e. seeing the translation happen in the app. Also, some strings have duplicates somewhere else in texts.php and they can mean different things depending on context, and only a real time reviewing of a translation directly in its usage context (admin and client UI) can make sure it’s appropriate. This inability thus far is possibly why the French Canadian translation is so ridden with syntax errors, wrong meanings or bad uniformity/continuity. I was eager to help the project but without an option to see the results, it’s a bit less encouraging. Which brings us to point 2.

  2. The Custom Labels > Add Custom > Labels option leads us to texts.php on Github, which lists what seems to be every text string in IN as a “label”; I was thus wondering if one could use the “Custom Labels” feature to test a translation of the interface before pushing it to Transifex. Which brings us to point 3.

  3. I can’t tell if Custom Labels work at all for the UI of the admin panel (or if they’re supposed to or not), because they don’t work for invoices or other generated PDFs (at least on my install), so if they’re broken somwhere, they could be broken somewhere else. I didn’t realize this at first because I started by only creating a few invoice related labels that were working fine on my invoice design (which is a work in progress, so I haven’t really started issuing invoices yet). Only when I started creating some test invoices did I notice that the custom labels were not being applied…

So all in all, the three points are related to issues with customizing the app language, be it in it’s admin UI, it’s client UI or in the files it creates, but only the third point that we were discussing about is related to the actual invoices and not the admin UI.

@stephlegrand You are not alone. :sweat_smile:

Hi @charles

We merge the transifex translations manually and it does take a bit of resources to do this, so this is something that isn’t done frequently. If you have finished the translations to your liking, i can organise another merge.

In regards to translations appearing in the UI @hillel will need to advise.

Finally, In the latest codebase, I can consisitently produce PDFs with the correct custom translations. If you are seeing troubles here you may want to investigate any caching that may be happening in the browser.

Hello @david,

We merge the transifex translations manually and it does take a bit of resources to do this, so this is something that isn’t done frequently. If you have finished the translations to your liking, i can organise another merge.

I didn’t know the merging was done by hand, sorry. I thought it was more of an semi-automatic process that would happen from time to time during your development schedule. That being said, no, I can’t say that my translation review is done as I haven’t checked all strings yet, but as I said it’s hard to know what string is used where, so it’s very hard to do a context-sensitive for some translations without seeing the words used in the interface somewhere. Still, if there is no other option, I guess I’ll do my best and I’ll fix errors once the first correction batch will have been imported.

In regards to translations appearing in the UI @hillel will need to advise.

:crossed_fingers:

Finally, In the latest codebase, I can consisitently produce PDFs with the correct custom translations. If you are seeing troubles here you may want to investigate any caching that may be happening in the browser.

Yeah I’m sorry if I’m asking you to find non existent bugs! I really have absolutely no idea of where to look for my problem. Everything else works with IN so far that I’ve tried (and the glitches I reported have all been fixed), but this one is sticking.

  • I have opened up my browser dev tools and I ticked the “Deactivate cache” option;
  • I have added '<FilesMatch “.pdf$”> Header set Cache-Control no-store ’ to my .htaccess file in /public as described in your documentation;
  • I made sure that Cloudflare was set in “DNS only” mode for my Invoice Ninja subdomain;
  • I made sure that the custom labels appear correctly in both the PDF and the HTML preview of the design editor;
  • I created new invoices for a different client than my last try, with brand new data all over;
  • I tried using the default designs instead of my custom one;
  • Result: the custom labels do not appear in the newly generated PDFs.

What could I be missing? Browser cache is probably not caching a file I just created, but just in case, it’s disabled on both the server and my browser! Any ideas of what else might be happening?

EDIT: I also tried hosted_ninja to generate the pdfs. It works fine to generate them, but I still have an issue with the custom labels not appearing.

@david

UPDATE: In my last post edit I said that generating PDFs locally was not working but I tried once more and BOOM, the custom labels are working!!

Therefore, there must be something wrong with the way PhantomJSCloud pulls the data to generate the PDFs.

@charles

Good to hear it is working.

1 Like

Sorry, we won’t be able to support showing custom labels in the admin portal.

1 Like

Hi @david,

I am not completely done yet but I have reviewed/updated several hundred of strings so far (including important ones), so the fr_CA file would be ready for an update whenever you have the time.

Thanks a lot!

Thanks @charles

I’ve updated the language file for you. This will be available in the next release.

Dave

1 Like