L10n:Migration: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
 
(48 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Clone everything that's needed ==
== Preparations ==
 
  mkdir releases && cd releases
  hg clone http://hg.mozilla.org/releases/mozilla-aurora
  hg clone http://hg.mozilla.org/releases/mozilla-beta


  mkdir releases && cd releases 
   mkdir -p l10n/mozilla-aurora
   mkdir -p l10n/mozilla-aurora
   mkdir -p l10n/mozilla-beta
   mkdir -p l10n/mozilla-beta
    
    
  export LOCS=`wget -qO- 'https://hg.mozilla.org/releases/l10n/mozilla-beta/?style=raw' | grep -v x-testing | awk -F/ '{print $5;}'`
Put this script (upclones.sh) in your $PATH:
Put this script (upclones.sh) in your $PATH:
<pre><nowiki>
<pre><nowiki>
Line 13: Line 12:
   
   
HERE=`pwd`
HERE=`pwd`
CHANNEL=$1
SHIPPEDLOCALES=$2


for loc in `cat $SHIPPEDLOCALES | awk '{print $1;}' | sort | uniq`; do 
for channel in aurora beta; do
    for loc in $LOCS; do 
 
        CLONE="$HERE/mozilla-$channel/$loc"
 
        if [[ -d $CLONE/.hg ]]; then
            hg -R $CLONE pull -u -r default
        else
            hg clone -r default https://hg.mozilla.org/releases/l10n/mozilla-$channel/$loc $CLONE
        fi
    done
done
</nowiki></pre>
 
Then, enable Axel's merge helper extension to hg:


    if [[ $loc == 'en-US' ]]; then
  hg clone https://hg.mozilla.org/users/axel_mozilla.com/branch-l10n/ ~/src/branch-l10n
        continue
 
    fi
Edit your ~/.hgrc accordingly:


    CLONE="$HERE/$loc"
  [extensions]
  ...
  merge-l10n = ~/src/branch-l10n/merge_l10n.py


    if [[ -d $CLONE/.hg ]]; then
Try it out with:
        hg -R $CLONE pull -u
    else
        hg clone ssh://hg.mozilla.org/releases/l10n/mozilla-$CHANNEL/$loc $CLONE
    fi


done
  hg help no-op-merge
</nowiki></pre>
Clone the l10n repos:


  cd releases/l10n/mozilla-aurora
There's also a test-suite in branch-l10n, which you can run to verify your version of mercurial works.
  upclones.sh aurora ../../mozilla-aurora/browser/locales/shipped-locales


  cd releases/l10n/mozilla-beat
    cd ~/src/branch-l10n/
  upclones.sh beta ../../mozilla-beta/browser/locales/shipped-locales
    python test.py


Check out https://l10n-stage-sj.mozilla.org/pushes/releases/l10n/mozilla to make sure you have the latest changesets in the l10n repos.  If you don't, run upclones.sh again.
If the extension works, you can proceed with the merge


== Merge ==
== Merge ==
Have LOCS set. Also, make sure ssh works for hg, we're pulling over https to speed things up.
The actual merge wants to happen closely to/after the en-US merge and its push to beta.
First, visit the l10n dashboard, and migrate the database. Adjust the time to just before the push to beta of en-US. Or either, if aurora at one point was pushed first. The page is https://l10n.mozilla.org/shipping/release/. Also, on that page, switch off `fallback` for Lightning.
Notes:
* Do not use wildcards in Mercurial commands, they won't work with --cwd
<pre style="overflow-x:scroll">cd releases/l10n
# This function can be used to ignore locales working on central, e.g.
# isCentralLocale $loc
# if [ $? -eq 1 ] ; then
#  # Ignore locales working on mozilla-central
#  continue
# else
#  # Do something for other locales
# fi
function isCentralLocale () {
  central_locales=(eo es-ES fr it pl ru)
  for locale in ${central_locales[@]}; do
    if [[ $locale == $1 ]]; then
      return 1
    fi
  done
  return 0
}
# Path to migration script, without trailing slash (removed if present)
# Use $HOME instead of ~ if needed
# migration_path="$HOME/mozilla-central/python/devtools/migrate-l10n/migrate"
# migration_path=${migration_path%/}
 
for loc in $LOCS; do
  # Default migration actions
  hg -R releases/l10n/mozilla-beta/$loc pull -u -r default
  hg -R l10n-central/$loc pull -u -r default
  hg -R releases/l10n/mozilla-beta/$loc no-op-merge -m"Migrating central to beta for Firefox 56" $PWD/l10n-central/$loc
  hg -R releases/l10n/mozilla-beta/$loc push -r default ssh://hg.mozilla.org/releases/l10n/mozilla-beta/$loc
done
</pre>
As we're continuing the localization with 56 on central, we stop pushing the beta merge to aurora,
so nothing like
<pre style="overflow-x:scroll">  hg -R mozilla-aurora/$loc pull -u -r default mozilla-beta/$loc
</pre>


  cd releases/
The following code is to be run for locales we merge from aurora to central:


  for loc in `cat mozilla-*a/browser/locales/shipped-locales|awk '{print $1;}'|sort|uniq`; do hg -R l10n/mozilla-beta/$loc no-op-merge -m"Migrating aurora to beta for Firefox 7" $PWD/l10n/mozilla-aurora/$loc; done
The following should work:  <code>ls | egrep -v "eo|es-ES|fr|it|pl|ru"</code>


== Push ==
<pre style="overflow-x:scroll">  # Specific for 55 on central, post 54 aurora:
for loc in $LOCS; do
  hg --cwd l10n-central/$loc pull -u -r default releases/l10n/mozilla-aurora/$loc
  hg --cwd l10n-central/$loc rm mobile/searchplugins
  hg --cwd l10n-central/$loc ci -m 'Bug 1347830, Bug 1324045 - Remove mobile/searchplugins'


Once the source migration is complete, push the merged repos back to h.m.o.
  hg --cwd l10n-central/$loc mv devtools/client/eyedropper.properties devtools/shared
  hg --cwd l10n-central/$loc ci -m 'Bug 1354647 - Move the eyedropper l10n strings to /devtools/shared/'


   cd releases/
   hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/advanced.dtd browser/chrome/browser/preferences-old/advanced.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/applications.dtd browser/chrome/browser/preferences-old/applications.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/containers.dtd browser/chrome/browser/preferences-old/containers.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/containers.properties browser/chrome/browser/preferences-old/containers.properties
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/content.dtd browser/chrome/browser/preferences-old/content.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/main.dtd browser/chrome/browser/preferences-old/main.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/preferences.dtd browser/chrome/browser/preferences-old/preferences.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/preferences.properties browser/chrome/browser/preferences-old/preferences.properties
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/privacy.dtd browser/chrome/browser/preferences-old/privacy.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/search.dtd browser/chrome/browser/preferences-old/search.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/security.dtd browser/chrome/browser/preferences-old/security.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/sync.dtd browser/chrome/browser/preferences-old/sync.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/tabs.dtd browser/chrome/browser/preferences-old/tabs.dtd
  hg --cwd l10n-central/$loc ci -m 'Bug 1343682 - Create temporary killswitch for preference reorg'


   for loc in `ls -1`; do hg -R $loc push -f; done
   # Push to central
  hg --cwd mozilla-aurora/$loc push -r default ssh://hg.mozilla.org/l10n-central/$loc
done
</pre>

Latest revision as of 08:35, 2 August 2017

Preparations

 mkdir releases && cd releases  
 mkdir -p l10n/mozilla-aurora
 mkdir -p l10n/mozilla-beta
 
 export LOCS=`wget -qO- 'https://hg.mozilla.org/releases/l10n/mozilla-beta/?style=raw' | grep -v x-testing | awk -F/ '{print $5;}'`

Put this script (upclones.sh) in your $PATH:

#!/bin/bash
 
HERE=`pwd`

for channel in aurora beta; do
    for loc in $LOCS; do  

        CLONE="$HERE/mozilla-$channel/$loc"

        if [[ -d $CLONE/.hg ]]; then
            hg -R $CLONE pull -u -r default
        else
            hg clone -r default https://hg.mozilla.org/releases/l10n/mozilla-$channel/$loc $CLONE
        fi
    done
done

Then, enable Axel's merge helper extension to hg:

 hg clone https://hg.mozilla.org/users/axel_mozilla.com/branch-l10n/ ~/src/branch-l10n
 

Edit your ~/.hgrc accordingly:

 [extensions]
 ...
 merge-l10n = ~/src/branch-l10n/merge_l10n.py

Try it out with:

 hg help no-op-merge

There's also a test-suite in branch-l10n, which you can run to verify your version of mercurial works.

   cd ~/src/branch-l10n/
   python test.py

If the extension works, you can proceed with the merge

Merge

Have LOCS set. Also, make sure ssh works for hg, we're pulling over https to speed things up.

The actual merge wants to happen closely to/after the en-US merge and its push to beta.

First, visit the l10n dashboard, and migrate the database. Adjust the time to just before the push to beta of en-US. Or either, if aurora at one point was pushed first. The page is https://l10n.mozilla.org/shipping/release/. Also, on that page, switch off `fallback` for Lightning.

Notes:

  • Do not use wildcards in Mercurial commands, they won't work with --cwd
cd releases/l10n

# This function can be used to ignore locales working on central, e.g.
# isCentralLocale $loc
# if [ $? -eq 1 ] ; then
#   # Ignore locales working on mozilla-central
#   continue
# else
#   # Do something for other locales
# fi

function isCentralLocale () {
  central_locales=(eo es-ES fr it pl ru)
  for locale in ${central_locales[@]}; do
    if [[ $locale == $1 ]]; then
      return 1
    fi
  done

  return 0
}

# Path to migration script, without trailing slash (removed if present)
# Use $HOME instead of ~ if needed
# migration_path="$HOME/mozilla-central/python/devtools/migrate-l10n/migrate"
# migration_path=${migration_path%/}
  
for loc in $LOCS; do
  # Default migration actions
  hg -R releases/l10n/mozilla-beta/$loc pull -u -r default
  hg -R l10n-central/$loc pull -u -r default
  hg -R releases/l10n/mozilla-beta/$loc no-op-merge -m"Migrating central to beta for Firefox 56" $PWD/l10n-central/$loc
  hg -R releases/l10n/mozilla-beta/$loc push -r default ssh://hg.mozilla.org/releases/l10n/mozilla-beta/$loc
done

As we're continuing the localization with 56 on central, we stop pushing the beta merge to aurora, so nothing like

  hg -R mozilla-aurora/$loc pull -u -r default mozilla-beta/$loc

The following code is to be run for locales we merge from aurora to central:

The following should work: ls | egrep -v "eo|es-ES|fr|it|pl|ru"

  # Specific for 55 on central, post 54 aurora:
for loc in $LOCS; do
  hg --cwd l10n-central/$loc pull -u -r default releases/l10n/mozilla-aurora/$loc
  hg --cwd l10n-central/$loc rm mobile/searchplugins
  hg --cwd l10n-central/$loc ci -m 'Bug 1347830, Bug 1324045 - Remove mobile/searchplugins'

  hg --cwd l10n-central/$loc mv devtools/client/eyedropper.properties devtools/shared
  hg --cwd l10n-central/$loc ci -m 'Bug 1354647 - Move the eyedropper l10n strings to /devtools/shared/'

  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/advanced.dtd browser/chrome/browser/preferences-old/advanced.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/applications.dtd browser/chrome/browser/preferences-old/applications.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/containers.dtd browser/chrome/browser/preferences-old/containers.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/containers.properties browser/chrome/browser/preferences-old/containers.properties
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/content.dtd browser/chrome/browser/preferences-old/content.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/main.dtd browser/chrome/browser/preferences-old/main.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/preferences.dtd browser/chrome/browser/preferences-old/preferences.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/preferences.properties browser/chrome/browser/preferences-old/preferences.properties
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/privacy.dtd browser/chrome/browser/preferences-old/privacy.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/search.dtd browser/chrome/browser/preferences-old/search.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/security.dtd browser/chrome/browser/preferences-old/security.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/sync.dtd browser/chrome/browser/preferences-old/sync.dtd
  hg --cwd l10n-central/$loc cp browser/chrome/browser/preferences/tabs.dtd browser/chrome/browser/preferences-old/tabs.dtd
  hg --cwd l10n-central/$loc ci -m 'Bug 1343682 - Create temporary killswitch for preference reorg'

  # Push to central
  hg --cwd mozilla-aurora/$loc push -r default ssh://hg.mozilla.org/l10n-central/$loc
done