Localization importer fails to accept `{1:string}` or `{named:string}` despite LocalizationTable documentation

Localization importer does not accept {1:string} or {named:string} despite LocalizationTable
documentation.

LocalizationTable documentation on the wiki specifies that

Parameters can have format specifiers like {1:int}, {1:fixed}, {2:string}. They will be used for locale aware number, date, and time formatting and will also be used by the auto-translation system to re-format supported types where specified.

Unfortunately, if you try to specify {1:string} or {named:string} the localization system errors out upon import.

Reproduction

  1. Attempt to import this localization table
Key,Context,Example,Source,es-es
Test,,,{1:string},{1:string}

Expected behavior: It uploads fine
Actual behavior: Error message, disallowing upload.

image

This isn’t horrible, but is rather unfortunate. I’d prefer if the system was updated, but documentation may be updated too.

2 Likes

My bad.

The string specifier was in the original spec but it wasn’t implemented apparently. Will remove it from the documentation until we can add it in. Sorry about that.

I’ll write up some more docs on the specifiers that aren’t currently documented as well.

While you’re here, what do you think the string specifier should do with a number? I’d lean towards throw (as int would for a string)

1 Like

Updated the docs with better documentation of our supported format specifiers.

1 Like

I think it should throw, but Roblox’s API is very liberal at trying to cast things.

I think it’s better to be specific and have it error out if you don’t pass a string.

1 Like

Why was the string specifier removed? I’m trying to create a pattern that would allow me to wrap stuff like

20 Diamond, 5 Coal, 10 Gold
10 Azure, 20 Diamond, 30 Emerald
… etc

all under a single pattern.
I’m trying to do it like this:

but it’s not working? What’s the proper way to pull something like this off?

All it ends up doing is removing the first number:

image

The Source column should have the value with the parameters too. Correct me if wrong but it appears that your second column here is Source, and I only see static strings here without parameters.

Example of what it should be like: (Source should be same as en-us)
image

It wasn’t; string specifier is just i.e. {1} (not {1:string})

My table actually doesn’t have a en-us tab! No need to translate to the default language I guess…

The second column is the example tab and the third is the source.

So why isn’t this working?

(source)

It gives me this error and then destroys everything inside of replicatedstorage…

image

I got it! Turns out what I was doing originally was working, but my strings were too ambiguous and every single possible pattern was being matched to the first, {1:int} {2} pattern. I fixed this by adding periods to all of the strings

voila

image

Yeah, translate and string/default both match like a greedy .* regex. I’ll have to figure out a way to document that properly.

I thought I fixed that ReplicatedStorage missing on error issue. I might not have enabled the fix. I’ll check that out today too.

1 Like