Menu structure and translation


(Luca) #1

Hi Guys, we now have a new and sexier menu structure on MDN. The menu is no longer built-in a macro, but it is part of the main page of B2G OS on MDN. To be precise, you can
find it at the end.

MDN recognise H2 ‘Subnav’ and set the related numbered list as default menu for all the pages listed in it. In fact:

  • you don’t need to paste and copy the menu in each page (it’s important to have it only in the main one);

  • you can also remove code related to the previous sidebar “{{firefoxossidebar}}”

As you can see, the menu is now nothing more than a list, and you can edit it really simply.

For translators: just paste and copy the english menu structure, than translate list elements and correct links if you already have that page translated. Remember to remove the
"{{firefoxossidebar}}" code from other pages, or the old sidebar will be shown under the new menu.

More important, I lost a bit of time trying to reorganize the menu itself, cause I found the previous order a bit confusing. Feel free to share your ideas and opinion on the new structure.

I hope everyone can now find easely what he is looking for.


#2

maybe @chrismills can answer this… :slight_smile:


(Chris Mills) #3

In a word, yes. The sidebar is generated by the following macro code:

https://developer.mozilla.org/en-US/docs/Template:FirefoxOSSidebar

The strings are stored in the object contained in the localString method starting at line 15. We could add members relating to other languages, containing translated versions of the strings (in the same structure as the ‘en-US’ member already there), and the macro would automatically show the right strings for the MDN locale being viewed.

Access to editing macros is restricted, so I would need to upload the code for now. Let me know if anyone would like to take on a translation and wants some help.


(Luca) #4

Thank you, both, for the reply. Thank you for the explanation. I’m going to translate the strings and send you everything as soon as possible, Chris! In case of need, i’ll send you a pm!


(Luca) #5

@chrismills, I’m finishing this part of the macro

var text = mdn.localString({
‘en-US’: {
‘Build_and_install’: ‘Build and install’,
‘Build_and_install_overview’: ‘Build and install overview’,
‘B2G_OS_build_process_summary’: ‘B2G OS build process summary’,
‘Build_prerequisites’: ‘Build prerequisites’,
‘Preparing_for_your_first_build’: ‘Preparing for your first build’,
‘Building_B2G_OS’: ‘Building B2G OS’,
‘B2G_installer_add-on’: ‘B2G installer add-on’,
‘Building_B2G_OS_for_Flame_on_Mac_OS_X’: ‘Building B2G OS for Flame on Mac OS X’,
‘Choosing_how_to_run_Gaia_or_B2G_OS’: ‘Choosing how to run Gaia or B2G OS’,
‘Compatible_Devices’: ‘Compatible Devices’,
‘Building_the_B2G_OS_simulator’: ‘Building the B2G OS simulator’,
‘Using_the_B2G_OS_emulators’: ‘Using the B2G OS emulators’,
‘Installing_B2G_OS_on_a_mobile_device’: ‘Installing B2G OS on a mobile device’,
‘Creating_and_applying_B2G_OS_update_packages’: ‘Creating and applying B2G OS update packages’,
‘Building_and_installing_FOTA_community_builds’: ‘Building and installing FOTA community builds’,
‘B2G_build_variables_reference_sheet’: ‘B2G build variables reference sheet’,
‘Porting_B2G_OS’: ‘Porting B2G OS’,
‘Porting_overview’: ‘Porting overview’,
‘Porting_basics’: ‘Porting basics’,
‘Porting_on_CyanogenMod’: ‘Porting on CyanogenMod’,
‘Developing_Gaia’: ‘Developing Gaia’,
‘Developing_Gaia_overview’: ‘Developing Gaia overview’,
‘Running_the_Gaia_codebase’: ‘Running the Gaia codebase’,
‘Understanding_the_Gaia_codebase’: ‘Understanding the Gaia codebase’,
‘Making_Gaia_code_changes’: ‘Making Gaia code changes’,
‘Testing_Gaia_code_changes’: ‘Testing Gaia code changes’,
‘Submitting_a_Gaia_patch’: ‘Submitting a Gaia patch’,
‘Gaia_build_system_primer’: ‘Gaia build system primer’,
‘Customizing_build-time_apps’: ‘Customizing build-time apps’,
‘Market_customizations_guide’: ‘Market customizations guide’,
‘Customizing_the_keyboard_in_B2G_OS_apps’: ‘Customizing the keyboard in B2G OS apps’,
‘Localizing_B2G_OS’: ‘Localizing B2G OS’,
‘Make_options_reference’: ‘Make options reference’,
‘Gaia_tools_reference’: ‘Gaia tools reference’,
‘B2G_OS_add-ons’: ‘B2G OS add-ons’,
‘B2G_OS_add-ons_overview’: ‘B2G OS add-ons overview’,
‘Developing_B2G_OS_add-ons’: ‘Developing B2G OS add-ons’,
‘B2G_OS_APIs’: ‘B2G OS APIs’,
‘Porting_B2G_onto_Nexus_Player_(Lollipop)’ : ‘Porting B2G onto Nexus Player (Lollipop)’,
‘Raptor’ : ‘Raptor: Performance Tools for Gaia’,
‘Different_ways_to_run_Gaia’ : ‘Different ways to run Gaia’
}
});
%>

Do I have to translate something in the “Quick links” section, from line 62 to 119?


(Luca) #6

The italian translation is almost complete. Just to update the community, if someone else would translate the sidebar, lines to translate are those above.


(Lapineige) #7

A big thanks to the Italian translation team :wink:


#8

Hi Luca
I made a German version: https://hackmd.io/s/BkD-Ysu9
im not sure if “de-DE” is the correct way to link it…
And i don’t know where to put it now… :slight_smile:
Can you add it?


(Luca) #9

Novski, first of all thanks for your help. Unfortunately, meanwhile a pair of strings have been removed (commented to be more precise, as you can see those lines start with a /) and others have been changed.

As base, did you use my previous post or the macro itself?

Regarding the first line, it’s fine to use simply “de”, instead of “De-de”.

@kskarthik, can you help us on that? I have to update italian translation too :slight_smile:


(Luca) #10

@Novski, from what I can understan your translation is fine. Just need to change:

  1. Modify Line 2

From de-DE’: { to ‘de’: {

  1. Remove lines:

    ‘Building_the_B2G_OS_simulator’: ‘Erstellung des B2G OS Simulators’,
    ‘Using_the_B2G_OS_emulators’: ‘Anwendung des B2G OS Emulators’,

  2. Add and translate Mulet page, between Raptor and Different ways to run Gaia:

    ‘Mulet’ : ‘Run gaia on desktop using Mulet’,


#11

ok done: https://hackmd.io/s/BkD-Ysu9
I think that note should now be editable for everyone…


(Luca) #12

I had to click on the pencil, sorry :sweat_smile: Thank you for updating it!


(Sai Karthik Karra) #13

added the translation :slight_smile:


#14

where and how? :grin:


(Sai Karthik Karra) #15

Here https://developer.mozilla.org/en-US/docs/Template:FirefoxOSSidebar But we dont have german translation page yet for b2G OS. So, i placed the strings in comments


#16

isn’t that a german version? https://developer.mozilla.org/de/docs/Mozilla/B2G_OS
Am i missing someting? :slight_smile:


(Sai Karthik Karra) #17

I will add it. See new sidebar by Luca, he has done a great job


(Luca) #18

Hi Guys, as Sai said, we now have a new and sexier menu structure on MDN. The menu is no longer built-in a macro, but it is part of the main page of B2G OS on MDN. To be precise, you can find it at the end.

MDN recognise H2 ‘Subnav’ and set the related numbered list as default menu for all the pages listed in it. In fact:

  • you don’t need to paste and copy the menu in each page (it’s important to have it only in the main one);

  • you can also remove code related to the previous sidebar “{{firefoxossidebar}}”

As you can see, the menu is now nothing more than a list, and you can edit it really simply.

For translators: just paste and copy the english menu structure, than translate list elements and correct links if you already have that page translated. Remember to remove the “{{firefoxossidebar}}” code from other pages, or the old sidebar will be shown under the new menu.

More important, I lost a bit of time trying to reorganize the menu itself, cause I found the previous order a bit confusing. Feel free to share your ideas and opinion on the new structure.

I hope everyone can now find easely what he is looking for.


(Sai Karthik Karra) #19

Better you make it a seperate topic :slight_smile:


(Luca) #20

Just edited the first post :slight_smile: The topic, imho, is almost the same!