THE FLUENT LANGUAGE
A localization system for
natural-sounding translations
by Macabeus
Slide 2
Slide 2 text
A language for
localization
Do we need it?
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
First version
“Let’s hardcode all strings!
It won’t be an issue!”
Slide 5
Slide 5 text
Second version
“Let’s map our strings in
both languages into json
fi
les”
Slide 6
Slide 6 text
Third version
🤷
Slide 7
Slide 7 text
But I'm sure sure I need to support English only...
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
Before talking
the technical
side, let’s
talk about our
languages
Slide 10
Slide 10 text
Our
languages
are diverse
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
No content
Slide 14
Slide 14 text
In French, zero is singular!
Slide 15
Slide 15 text
Polish is a language with the paucal numbers.
We have one word for few, and another word for many
?????
Slide 16
Slide 16 text
Do you want to remove the
fi
le(s)?
File A
File B
…
Slide 17
Slide 17 text
Gender
Article
Grammatical Case
Politeness
…
Slide 18
Slide 18 text
There are
many rules
w i
thin each
language
Slide 19
Slide 19 text
We need to
map these
rules in
our code
Slide 20
Slide 20 text
But how to
do it in a
scalable
way?
Slide 21
Slide 21 text
XLIFF
Slide 22
Slide 22 text
ICU MessageFormat
Slide 23
Slide 23 text
Hey, he found 2 results.
{
GENDER: 'male',
RES: 2
}
ICU MessageFormat
+
=
Slide 24
Slide 24 text
ARB
Slide 25
Slide 25 text
ARB
✔ Popular format
𝓍
Don’t have comments
𝓍
Verbose
𝓍
Code reuse is hard
Slide 26
Slide 26 text
FLUENT
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Fluent is a Mozilla
language developed with
the aim of solving issues -
and we can also take
advantage of it to solve our
issues
Slide 29
Slide 29 text
“ With almost 100
supported languages,
Firefox faces many
localization challenges. ”
Slide 30
Slide 30 text
No content
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
“ There are many
grammatical and
stylistic variations that
don’t map one-to-one
between languages. ”
Slide 33
Slide 33 text
Asymmetric
Localization
Slide 34
Slide 34 text
No content
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
No content
Slide 37
Slide 37 text
Referencing Messages
Selectors
Variables
Attributes
Comments
Functions
Writing Text
Slide 38
Slide 38 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 39
Slide 39 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 40
Slide 40 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 41
Slide 41 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 42
Slide 42 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
The star indicates the “default” variant.
A default variant is required
Slide 43
Slide 43 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 44
Slide 44 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 45
Slide 45 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 46
Slide 46 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 47
Slide 47 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 48
Slide 48 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 49
Slide 49 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 50
Slide 50 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 51
Slide 51 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 52
Slide 52 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 53
Slide 53 text
Selectors
Variables Comments
Functions
Writing Text Referencing Messages Attributes
Slide 54
Slide 54 text
Fluent is
just the
format.
We need a
client
Slide 55
Slide 55 text
No content
Slide 56
Slide 56 text
@
fl
uent/bundle
@
fl
uent/react
(vanilla)
(it isn't
fl
uent-
fi
rst)
i18next
Developed
by Mozilla
Slide 57
Slide 57 text
@
fl
uent/bundle @
fl
react-i18next
Slide 58
Slide 58 text
@
fl
uent/bundle @
fl
react-i18next
Slide 59
Slide 59 text
@
fl
uent/bundle @
fl
react-i18next
Slide 60
Slide 60 text
@
fl
uent/bundle @
fl
react-i18next
Slide 61
Slide 61 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Check the full code here
Slide 62
Slide 62 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 63
Slide 63 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 64
Slide 64 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 65
Slide 65 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 66
Slide 66 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 67
Slide 67 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 68
Slide 68 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 69
Slide 69 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/coralproject/talk
Slide 70
Slide 70 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/coralproject/talk
Slide 71
Slide 71 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 72
Slide 72 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 73
Slide 73 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 74
Slide 74 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 75
Slide 75 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 76
Slide 76 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/pontoon
Slide 77
Slide 77 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 78
Slide 78 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/
fi
refox-devtools/pro
fi
ler
Slide 79
Slide 79 text
@
fl
@
fl
uent/react react-i18next
Original and full code on github.com/mozilla/fxa
Slide 80
Slide 80 text
@
fl
@
fl
react-i18next
Slide 81
Slide 81 text
@
fl
@
fl
react-i18next
Slide 82
Slide 82 text
@
fl
@
fl
react-i18next
Slide 83
Slide 83 text
No content
Slide 84
Slide 84 text
No content
Slide 85
Slide 85 text
No content
Slide 86
Slide 86 text
No content
Slide 87
Slide 87 text
Who is
using
Fluent?
Slide 88
Slide 88 text
No content
Slide 89
Slide 89 text
No content
Slide 90
Slide 90 text
No content
Slide 91
Slide 91 text
No content
Slide 92
Slide 92 text
Furthermore…
Slide 93
Slide 93 text
project
fl
uent.org/play
Slide 94
Slide 94 text
github.com/mozilla/pontoon
Slide 95
Slide 95 text
github.com/macabeus/
fl
uent-typescript
Slide 96
Slide 96 text
github.com/macabeus/
fl
uent-typescript
Slide 97
Slide 97 text
github.com/macabeus/vscode-
fl
uent
Slide 98
Slide 98 text
github.com/macabeus/vscode-
fl
uent
Slide 99
Slide 99 text
github.com/macabeus/vscode-
fl
uent
Slide 100
Slide 100 text
github.com/macabeus/vscode-
fl
uent
Slide 101
Slide 101 text
github.com/macabeus/vscode-
fl
uent
Slide 102
Slide 102 text
github.com/macabeus/vscode-
fl
uent
Slide 103
Slide 103 text
github.com/macabeus/vscode-
fl
uent
Slide 104
Slide 104 text
github.com/macabeus/vscode-
fl
uent
Slide 105
Slide 105 text
No content
Slide 106
Slide 106 text
No content
Slide 107
Slide 107 text
No content
Slide 108
Slide 108 text
Macabeus
Software Engineer
at Anima
/macabeus
/bmacabeus
macabeus.github.io