Page 8 of 9 FirstFirst ... 6789 LastLast
Results 71 to 80 of 87
  1. #71
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Hi, brief summary of work done the last week.
    I had installed the Multi Language Country Names (MLCN) module, and after studying it, decided to implement a similar extension for zone names. The zone names (and zone codes) mix with country names in some parts of the admin code - I haven't yet worked on the non-admin code, except to list which files dealt with or depended on zone information, and to note that there are potentially far more files to modify than for country names.
    Since I worked from the MLCN module, I could create an installer, finding out just how fragile that method is also (if it breaks somewhere in the initial installer code), so having an SQL uninstaller ready is also important for redoing the configuration easily.
    For the multi language zone names, I used a table zones_name that takes over the fields of the zones table, and adds language_id as does the MLCN module, and also zone_code_iso which is the international code for zones of countries (ISO 3166-2), similar to the 2-letter and 3-letter ISO codes for countries.
    When editing zones one now sees the zones for all languages (I have not implemented a filter per language), but when editing a zone one has the ability to edit the zone name and zone code for each language, as well as input the ISO zone code. This code is now also displayed in the zones listing.
    About the same amount of core files were changed for the admin side to implement this feature (countries.php was not required to be edited further).
    When I have finished on the non-admin files later this week I hope I can put up my files for others to benefit from.

  2. #72
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Uploading Zones listing in English and Japanese as it stands now, with multi language support, display fixed to display by language only (ISO code not currently in the summary window, but it is visible in the edit interface). Example of edit interface for either language for Hyogo prefecture also shown.
    With this part done for now, I plan to add the display functionality to the customer side over the next few days bit by bit (since there are many areas where zones are used).

    Aside:
    With the multi language country name (and I have done the same for zones) I noticed that inserting countries/zones only adds the name to the extended table, with no entry in the original table. I think it might be better to put something into the original table, either in English, or in the default language of the installation.
    And, for deletion, only the entry from the orginal table is removed, the extended table entries remain (but will no longer be accessed).
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot from 2017-10-31 01-32-30.jpg 
Views:	38 
Size:	31.8 KB 
ID:	17386   Click image for larger version. 

Name:	Screenshot from 2017-10-31 01-31-49.jpg 
Views:	35 
Size:	34.7 KB 
ID:	17385   Click image for larger version. 

Name:	Screenshot from 2017-10-31 01-37-30.png 
Views:	31 
Size:	16.4 KB 
ID:	17387  

    Click image for larger version. 

Name:	Screenshot from 2017-10-31 01-38-44.png 
Views:	58 
Size:	16.0 KB 
ID:	17388  

  3. #73
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Some updates:
    I've documented all files changed for multi language zones, as well as whether I could override them or not, and where the additions are combined with changes needed for the multi language country name module. I'll put up the list later this weekend.

    After completing that, I've tuned the <admin>/includes/stylesheet.css to help manage the admin navigation menu. Japanese wording makes the buttons larger and breaks the line into two lines, reducing font from 11px to 10px fixes this without making the English version any harder to read. Ideally, each page might have a language tag, allowing for different CSS files per language... in future.
    Also, I set up a hopefully web-safe font selection that supports Japanese, maybe not the best choice (I think I have only variable-width fonts there) but if it works as I expect it will enable users on linux, Windows and Mac OSes to see the site reasonably well utilizing their system fonts. Verdana is still the preferred font family for English.

    1. Added fixed size for links:
    Code:
    a.headerLink:link {
        font-size: 10px; /* Japanese fonts require smaller size */
    2. replaced font with font-family choice, keeping other options the same.
    Code:
    a, body, html, table {
        /* font: normal normal 11px Verdana, sans-serif; */
        /* experiment for Japanese */
        font-style: normal;
        font-variant: normal;
        font-weight: normal;
        font-size: 11px;
        font-family : Verdana, "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", Osaka, "Noto Sans Japanese", "游ゴシック", "游ゴシック体", "YuGothic", "Yu Gothic", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", "MS ゴシック", "MS Gothic", HiraKakuProN-W3, "TakaoExゴシック", TakaoExGothic, MotoyaLCedar, "Droid Sans Japanese", Arial, sans-serif;
    I've been mulling a few issues and wondering if I have missed something and/or how to approach them:
    1. I haven't touched any files where only the zone_id is required. This includes, geo zones, there are quite a few places where table TABLE_ZONES_TO_GEO_ZONES is used, but I think I don't need to touch this. I hope this is OK.
    2. For Paypal modules, setting the state seems to be required for Japan, according to comments in the module file (paypalwpp.php, paypaldp.php), but as far as I can tell, nothing is set. I've posted a question in the support forum (Ref: https://www.zen-cart.com/showthread....tain-countries) about this. If necessary, I'll probably create a lookup table specifically for Paypal.
    3. Meaning of Japan country_id of 107. This is not an ISO country code as far as I can tell, is this only internal to Zen Cart? Paypal for example specifies some numerical codes for each country which seem to be ISO numerical codes (separate from the ISO 2-letter or 3-letter codes). Is there a need for the ISO numerical codes, and if so, is there a relationship to the Zen Cart country codes?
    4. Adding different address formats for a single country: this is clearly an issue with many countries and cultures that do not use Latin alphabets, and where the order and punctuation of an address is different for local and English writing. I will probably need to create a separate table for Japanese addresses, and expose the choice of language and/or address format code in the GUI (not to mention giving examples of the format, since this might be required for comparison to Paypal and other payment/shipping modules).
    Best regards,
    Gernot Hassenpflug

  4. #74
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    One further issue, while trying to set up categories and manufacturers. Categories are already multi-language with a language pack addition, but manufacturers do not seem to be. I am not sure whether this is a bug in the Japanese language pack I ported, but obviously I need to solve this by doing some more customizing (or finding a bug in my porting). The URL for manufacturer is customizable per language, but not the name.
    Unlike for categories, there is no description either - I did see there are a few manufacturer-related add-on modules that might help (Manufacturers All About, for example).

  5. #75
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Regarding address_format, after mulling over several options, and weighing up how much effort each would be to implement, versus the customer-side effort in understanding the logic, I came up with the following ideas:

    1. Simplest idea

    Extend or create a new table for address_format, including langauge_id.
    In this case, the function zen_get_address_format_id could be extended to include language_id as a parameter (or just use $_SESSION['languages_id'] in the function itself) to return the address format suitable for the current language.
    This would make it relatively easy for customers (and admins) to enter/edit addresses directly in their own and other languages, and choose the one to use later.
    The downside is that the display of all addresses still follows only the address format in force.

    2. More complex idea

    Keep address_format table as is, but add formats to it to support whatever format is required for different languages (in particular, Japanese addresses written out in Japanese versus written out in English).
    Extend address_book format to include address_format (and maybe language_id) to override the country default address_format.
    Then, extend customer.php and various address_book and address display files (by my count 8 admin, 13 customer-side) as applicable to expose the choice of address_format (and maybe language), and display addresses dependent both on their format and language. The reason for exposing language is that for now the country and zone are (often/always?) auto-selected rather than being read from the address_book, so their display would need to be controlled to match the rest o the address.

    Any thoughts welcome.

  6. #76
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Extending manufacturers to be multi langauge involves at likely some or all of 7 admin and 12 customer facing files, and the creation of an extended set of tables, quite a large overhead for adding multi-language capability to just one field (name), especially since the URL is already multi-langage capable. Oh well, manufacturers would need a new table, but manufacturers_info would stay as it is.

  7. #77
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Worked on extending the address_book to handle different formats for a single country. The countries table now contains the default address format, but each address can be specified to have its own one. Obviously various code parts will need to reference this instead of the countries field.

    1. Added English address format and correct Japanese one in address_format table:
    1.1 updated Japanese format for Japan (last name first):
    update address_format set address_format='$lastname $firstname$cr$postcode$cr$state$city$cr$streets$cr$country$cr$telephone$cr$fax' where address_format_id=8;
    1.2 inserted English format for Japan:
    insert into address_format (address_format,address_summary) values ('$firstname $lastname$cr$streets$cr$city, $state$cr$postcode $country$cr$telephone$cr$fax','$city, $state');

    2. Extended countries_name table:
    2.1 created new field:
    ALTER TABLE countries_name ADD address_format_id int(11) NOT NULL default 0;
    2.2 populated new field:
    UPDATE countries_name INNER JOIN countries ON countries_name.countries_id = countries.countries_id SET countries_name.address_format_id = countries.address_format_id
    2.3 updated English Japan to be format 9 (new English format inserted above):
    update countries_name set address_format_id = 9 where countries_name = 'Japan';
    2.3 updated countries table to also use default English format:
    update countries set address_format_id = 9 where countries_name = 'Japan';

    3. Extended address_book table:
    3.1 added address_format_id and language_id fields:
    ALTER TABLE address_book ADD address_format_id int(11) NOT NULL default 1;
    ALTER TABLE address_book ADD language_id int(11) NOT NULL default 1;
    3.2 set address_format_id and language_id appropriately per existing addresses:
    For addresses in Japan, written in Japanese: address_format_id=8, language_id=3 (Japanese)
    For addresses in Japan, written in English: address_format=9, language_id=1 (English)

    4. WIP: Update admin code that looks in address book to also get the address_format_id and language_id from there.
    So far handled customers.php and functions_customers.php to obtain following results:
    4.1 listed addresses for a customer using the format in the address_book for each address. This makes addresses entered in English and in Japanese appear in their respective formats.
    4.2 update address for a customer with addition of a language field, the setting of which chooses the address format to use for the address, based on the country chosen (by default, the same address format is in use for all languages, unless set differently in the multilanguage contries_name table).
    4.3. WIP: still figuring out how to handle the various forms of error (error, specific field error, no error), and whether to display drop-down, or text fields in which case (confusing for country and zone/state as well).
    4.4. TODO: still have to handle other parts of the admin code, like invoice, orders, packingslip.

    5. TODO: Update the customer-facing GUI to expose address format and language for entering and updating addresses
    Not done this part yet, but since admin part logic is working, this should be fairly straightforward, though perhaps tedious.
    Last edited by gernot; 5 Nov 2017 at 05:07 PM.

  8. #78
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Needed to work more on Javascript code to update country and state pull-down lists automatically based on (new) language_id format selection, and also set the default country and state pull-down to work with the (new) language_id format saved in address_book for each address.
    Examples via screenshots, showing the different address formats per user for a single country including name/surname order, and address sub-section order changes (two different address_formats, each saved with the address), and how the language choice is incorporated into the customer address editing screen in the admin GUI.
    I've made it that the state pull-down has the zone_id as the value, since it makes more sense to me, as country pull-down also has it this way.
    Not sure why entry_state is only saved in the original code (as a state name) if zone_id is 0, but I am keeping it that way, so in practice not much has changed (only some DB lookups need to use zone_id, or in fact become superfluous since original code had to get the zone_id from zone_name).

    Took a lot of time to learn the interaction of PHP and Javascript, defaults and onChange operations, still need to go through the related files on the admin side.

    Already ported the new functions from admin side to customer side for general usage (html_output.php and functions_general.php), but not yet in use, nor checked the various usages in customer-facing files (multiple jscript_addr_pulldowns.php, on_load_main.js) and templates.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot from 2017-11-12 23-12-10.png 
Views:	34 
Size:	21.6 KB 
ID:	17416   Click image for larger version. 

Name:	Screenshot from 2017-11-12 23-12-51.png 
Views:	36 
Size:	14.3 KB 
ID:	17417   Click image for larger version. 

Name:	Screenshot from 2017-11-12 23-13-10.png 
Views:	36 
Size:	15.5 KB 
ID:	17418  

    Click image for larger version. 

Name:	Screenshot from 2017-11-12 23-13-43.png 
Views:	28 
Size:	15.0 KB 
ID:	17419  

  9. #79
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Progress on the customer facing-side, displaying addresses in the format appropriate both to country and language, as specified in the address_format_id and language_id fields added to address_book table.

    I first attempted to tackle the shipping estimator, made up of the module file and template file.
    I could successfully handle the display of the short form of the address in the pull-down menu in the shipping estimator pop-up, since that is set up by a MySQL search inside the module file.
    However, despite adding some echo statements to if/else parts of the shipping estimator module file, I have not been able to grok how the full address display in the pop-up is generated or taken from. This address is referenced as order->delivery in the call to zen_get_address in the template file, and is updated when the pull-down menu selection is changed (using an onChange call which resubmits the entire form). I cannot figure out where order->delivery is set up or how it is updated on submit in the module file. As far as I can tell, for my case as a signed-in customer, no other Javascript is involved (other processing flows exist for users who are not signed in), so I surmise the original date and any updates must be processed in PHP somewhere (I have looked at order.php also briefly but I think the update processing is limited to the shipping estimator module file alone).
    Any help in understanding would be most appreciated.
    Last edited by gernot; 16 Nov 2017 at 01:51 AM.

  10. #80
    Join Date
    Feb 2017
    Location
    Tokyo, Japan
    Posts
    263
    Plugin Contributions
    0

    Default Re: Future Japanese Language Pack Status, version 1.5.5 and beyond...

    Problem solved! It appears that the class order.php is indeed the origin of the order->delivery information, via shipping_address, which is updated on each submit via the variable sendto (which is the selected address_id from the pull-down menu).
    Modifying the MySQL query for shipping_address to use the new address_format_id from address_book (instead of from the countries table) and language_id, enabled me to obtain the correct format and language for country and zone in the full address in the shipping estimator pop-up.

    Note: I added the Japanese postcode sign "〒" in front of postcode in the address format, but needed a space separation on either side, else whatever it was touching would be ignored. This worked fine. However, I was unable to do the same with "様" ( read as "sama") after the name, since this would then be parsed as part of the succeeding address component. I am not sure if one can add such a component in the address_format directly, but if so, it would be great to know.
    The only alternative I see at present is to output it on demand each time in the code, depending on language_id I suppose.

 

 
Page 8 of 9 FirstFirst ... 6789 LastLast

Similar Threads

  1. Japanese Language Pack problem
    By i.chan in forum Addon Language Packs
    Replies: 1
    Last Post: 14 Jun 2009, 11:21 PM
  2. Japanese Language Pack
    By namasa in forum Addon Language Packs
    Replies: 74
    Last Post: 22 Dec 2008, 03:29 PM
  3. japanese language pack...
    By fish_who in forum Addon Language Packs
    Replies: 1
    Last Post: 10 Aug 2006, 04:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR