Open metaphore opened 8 years ago
Could you provide a code sample or a small project that recreates the issue? Or paste the complete stack trace of the exception? When I used this snippet in gdx-lml-tests
, it worked fine:
<:argument key="sample" value="test"/>
<label>@bundleLineWithArgument|{sample}</label>
This prints Received argument: test.
as expected.
@metaphore Is this still an issue?
@czyzby sorry, had no time to prepare code sample and check it once again. Will do it till the end of this week
Not a problem, take your time.
I had few experiments but for good (or bad) can't reproduce it anymore. I think it should be closed now and if problem will ever occur, I will supply you with details in that issue.
BTW, is there a way to conjunct two expressions next to each other like: @someString{someValue}
?
BTW, is there a way to conjunct two expressions next to each other like:
@someString{someValue}
?
I think that in this particular example it would currently replace someValue
and look for I18N line named someStringSomeValueResult
.
But labels are not multiline by default (you have to enable it first), so something like this:
<label>@someString
{someValue}</label>
...would result in a single string, joining the two inputs.
@czyzby probably I found what is origin problem was about. If I try to parametrize localized string with a value started with .
(e.g. file extension) it results in
I18N bundle not found for bundle line: @key.arg
And I guess it's pretty obvious why - LML treats key
as a bundle name. But still it looks like there is no way to put any value that starts from dot. May be is it possible to add some kind of escape character for such case?
Can you post a self-contained example of a LML template and the bundle line argument that reproduce the issue, so I can test it easily? I'll look into it before the next release.
Anyway, I suggest going for a workaround for now, like using a Java method for building this particular string or avoiding parametrization (if possible) when an argument with dot is present.
Sure, thanks. I believe this should be enough to reproduce the case:
bundle.properties
key = text {0} text
template.lml
<?xml version="1.0"?>
<!DOCTYPE label SYSTEM>
<label text="@key|.value"/>
Following this example from wiki
@key|only|@arg
I'm trying to pass argument to localized string as parameter:But as result parser searches for
key|{arg}
key in bundle (and crushes when not found).Am I missing something?