New dynamic constants do *not* localize


I’ve been using dynamic constants since the beginning of a project and they always worked fine.

Now, new dynamic constants are not “working” (only default language is used, not even if I specifically add “English” and a different value it displays the new value). Even duplicating old working ones and then renaming fails.

Tried clearing cache, other computers etc but still nothing.

The only thing I can think of is the number os constants in a single module, is there a limit?

Maybe it’s a reserved Xojo-Name?

I don’t think so… It’s a chronological issue and even if I delete an old one and re-create the problem repeats.

I just tried cutting and pasting from the module to classes, creating new in classes that do not have any constants and nothing works. Already tried saving as [i]new file[/b] etc… Kind of lost, first time I see this happening.

Also tried MsgBox(constant(“language_code”)) and it still prints the default.

What language code are you using?

Hi Greg,

I tried using session’s, manually typing it in etc. (“he”, “en”, “pt” etc)

Now I just created a new webapp project, constant etc and it works fine but the old project still doesn’t.

As far as I see it’s either related to the number of constants I have (old ones work, new don’t) or to the project file.

Im not aware of any limit, but if you’ll file a bug report, we can have someone take a look at it. Do you have any idea how many constants you have?

I will do that…

Just a new development: If I cut and paste an old and working dynamic constant, it stops working.

another development:

Exporting the module with the constants to a new project works fine… all constants work. Exporting again from the new to the old and they stop working…

What kinds of projects (they’re all the same type - web, desktop, etc ?)

yes, all web projects.

Just a summary:

I have a module with 100-120 constants. They worked fine so far and I think in the last 10 I added the problem started to occur.

Calling these constants with or without the language code will always display the default. The older ones work just fine but if I cut and paste the old, working ones, then they stop working.

Exporting the whole module and importing it into a new project seemed to fix the problem (at least the faulty ones worked). I’m not sure the problem was solved or the fault switched between constants since I didn’t try each one of the constants and introspection doesn’t (?) handle them so couldn’t iterate.

I tried exporting again from the new project and re-importing in the old one but the problems returned.

My constants are all named X_constantname. I have default as english and translations to hebrew and portuguese. tried adding english as well and the results were inconsistent and I can’t say it helped.

A quick check of the XML/Text module file didn’t reveal anything special between working and non working constants. Checked in plain text editor but nothing “rawer” than that.

I’d honestly have to see an example as we haven’t changed how dynamic constants (localized strings) work

Maybe something like this?

Hey Bob, thanks for the advice… I just tried and still the same behavior. :-/

I will try some other stuff and write back here.

Well, based on bob’s post I did copy the project to a different computer and installed xojo there. It all works fine…

I did clean the cache etc on the mac that has the problem but it didn’t solve it, what should I do? It’s clearly related to the machine/install itself and not to the project.

And these dynamic constants definitely all have the “Dynamic” flag set ?

yes, for sure. More than that: If I cut and paste a working one it stops working. But as I said above, I installed xojo on a different computer (pc) and ran the same project and it all seemed to work fine… So maybe it’s related to my mac install but the cleaning cache, restarting etc didn’t help so I’m now removing and installing xojo again.

Problem Solved.

Tried everything from reducing number of constants, cut/paste, export/import etc. Also tried cleaning up mac/xojo’s cache and even removing/installing the xojo ide. Still, didn’t work.

I did try running the project on a different computer (pc) and it worked fine so I knew it wasn’t the project itself BUT it was.

The file itself is somehow corrupt and copying the file somewhere else solved the problem.

btw, Thank you all for the time and support.

Well, my previous conclusion was incorrect.

Apparently it was way simpler than that. The “Resources” folder contained en.lproj, he.lproj files etc and they were the source of the problem. Once they were removed all projects worked fine.