International Help Needed

Troll-Brain

You can change this now in User CP.
Reaction score
85
Hmm, what exactly does this do? Does it check the name of a footmen for each player, and then if it is for example ''Soldat'', it knows your german?
Exactly.
It detects the warcraft language installed, not the player country.

But i can't use the Chinese and Russian letters in the editor, so i will deal with other localized strings, and the length of them.
Could you test the map and give me the strings ? (make screenshots of the chat box, since there are 24 strings)

Actually i have only the strings in French.
 

SerraAvenger

Cuz I can
Reaction score
234
Actually ?! , pity ...

Anyway he create an unit for no reason, and in fact i didn't know someone tried and posted it before me.
Btw, it's not the subject.


@Nexor : again, i don't want a word given by a translator, i want to be sure 100 %


I posted a reply over there on wc3jass that shows how I'ld do it.


The non BJ/ non native functions I use can either be found in my Utilities Library or in my Attachment system.
JASS:
library Attacher needs Hash
//! textmacro Attach takes NAME, ATTACHTYPE, ATTACHEDTYPE, DEFAULT

library_once $ATTACHTYPE$Converter
    function $ATTACHTYPE$2IntConverter takes $ATTACHTYPE$ which returns integer
        return which
        return 0
    endfunction
endlibrary

library $NAME$ initializer INIT needs $ATTACHTYPE$Converter, Hash
    
globals 
    private $ATTACHEDTYPE$ DefaultAttachment
    private $ATTACHTYPE$ array Check
    private $ATTACHEDTYPE$ array Attachment
    private hashtable Table
endglobals



function SetDefault$NAME$ takes $ATTACHEDTYPE$ attachment returns nothing
    set DefaultAttachment = attachment
endfunction

function GetDefault$NAME$ takes nothing returns $ATTACHEDTYPE$
    return DefaultAttachment
endfunction

function Set$NAME$ takes $ATTACHTYPE$ which, $ATTACHEDTYPE$ attachment returns nothing
    local integer id = $ATTACHTYPE$2IntConverter( which )
    local integer index = Table.Search( id )
    if index == -1 then
        set index = Table.Hash( id )
        set Check[ index ] = which
    endif
    set Check[ index ] = which
    set Attachment[ index ] = attachment
endfunction

function Get$NAME$ takes $ATTACHTYPE$ which returns $ATTACHEDTYPE$
    local integer id = $ATTACHTYPE$2IntConverter( which )
    local integer index = Table.Search( id )
    if index == -1 then
        return GetDefault$NAME$()
    endif
    
    if Check[ index ] != which then
        set Check[ index ] = which
        set Attachment[ index ] = GetDefault$NAME$()
    endif
    
    return Attachment[ index ]
endfunction


private struct $NAME$Struct
    method operator [] takes $ATTACHTYPE$ index returns $ATTACHEDTYPE$
        return Get$NAME$( index )
    endmethod
    
    method operator []= takes $ATTACHTYPE$ index, $ATTACHEDTYPE$ value returns nothing
        call Set$NAME$( index, value )
    endmethod
endstruct 

globals 
    $NAME$Struct $NAME$
endglobals

private function INIT takes nothing returns nothing
    set $NAME$ = $NAME$Struct.create()
    set Table = hashtable.create()
    set DefaultAttachment = $DEFAULT$
endfunction



endlibrary
//! endtextmacro
endlibrary

EDIT: Wth happened with spoiler tags oO
Is it just me or do they really malfunction?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
?!
No offense but you didn't post a function witch is doing the work, and the string you get is still local anyway.

Oh and i asked to edit the title, just read the first post of this thread, i guess i should create an other thread ...

EDIT : Since the function was old and not completed i didn't read the posts above, but anyway i don't wish any credits for that, i just want to make the function available.
 

SerraAvenger

Cuz I can
Reaction score
234
?!
No offense but you didn't post a function witch is doing the work, and the string you get is still local anyway.

Oh and i asked to edit the title, just read the first post of this thread, i guess i should create an other thread ...

EDIT : Since the function was old and not completed i didn't read the posts above, but anyway i don't wish any credits for that, i just want to make the function available.

I posted this function over there:

JASS:
globals
    constant integer LANGUAGE_OTHER   = 0
    constant integer LANGUAGE_ENGLISH = 1
    constant integer LANGUAGE_GERMAN  = 2
    constant integer LANGUAGE_SPANISH = 3
endglobals

//! runtextmacro Attach( "Language", "string", "integer", "LANGUAGE_OTHER" )
scope GetLang initializer INIT

function GetLanguage takes nothing returns integer
    return Language[ GetObjectName( 'hfoo' ) ]
endfunction

private function INIT takes nothing returns nothing
    set Language[ "Soldat" ]       = LANGUAGE_GERMAN
    set Language[ "Footman" ]      = LANGUAGE_ENGLISH
    set Language[ "Soldado raso" ] = LANGUAGE_SPANISH
endfunction
endscope

However, now that I think about it, it should be better this way:
JASS:

globals
                 integer Language
    constant integer LANGUAGE_OTHER   = 0
    constant integer LANGUAGE_ENGLISH = 1
    constant integer LANGUAGE_GERMAN  = 2
    constant integer LANGUAGE_SPANISH = 3
endglobals

//! runtextmacro Attach( "Language", "string", "integer", "LANGUAGE_OTHER" )
scope GetLang initializer INIT

private function INIT takes nothing returns nothing
    set Language[ "Soldat" ]       = LANGUAGE_GERMAN
    set Language[ "Footman" ]      = LANGUAGE_ENGLISH
    set Language[ "Soldado raso" ] = LANGUAGE_SPANISH
    set Language = Language[ GetObjectName( 'hfoo' ) ]
endfunction
endscope


However, the problem of the integer being local won't be fixed this way. That's true.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
My solution is simple, short and already work, select unit for a local player will fire the event for ALL players.
I can detect all the european warcraft languages but not the asian langagues yet.
I explained why and how i want to make it in the first post.

If someone of each nationality (at least for all warcraft languages) could test the map and give screenshots that would be great.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Dont forget the Brazil!!!!!! i.i

Portuguese(Brazil) - Soldado
o_O why blizzard don't talk about that in the official downloading patchs website.

Thx, but plz instead ,test the map in the first post and takes screenshot of the 24 strings displayed (in the chat box).
Or you could also try to share a replay, but i'm not sure i will get your localized strings in replay mode, i guess i will get mines ...

EDIT : I have attached the French screenshot of localized strings in the first post of this thread, just do the same :p
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
Thx, added.

Btw i'm feeling sorry for you, but so for me it will be needing less work :p
 

Magoiche

Member
Reaction score
20
At least someone can be happy...

Don't worry with me. I'm fine with english, i learned it in the best way!
How i learned? Playing games of course!
I play since i had 2~3 years i.i
But this don't come in this post.

Hope you can finish your trigger =P
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
In macedonian language is ''pomosh''
There is no macedonian patch, plz read carefully before posting ...

Again this is not for detect the Country of the player (there is banlist or such softwares for that), but to detect in game the warcraft language installed.

PS : I also need a better title :p
 

Igor_Z

You can change this now in User CP.
Reaction score
61
Ok sry, i just wanted to help. Good luck with your work
 

Romek

Super Moderator
Reaction score
964

Troll-Brain

You can change this now in User CP.
Reaction score
85
The title make more sense with the subject now , thx.
Could someone test the map (first post) and share the replay ?
And if you do it, give your warcraft's language also.
Thx.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top