What about internationalization? #AskPolymer -- Polycasts #33

Chrome for Developers · Beginner ·🌐 Frontend Engineering ·10y ago

Key Takeaways

Implements internationalization in a Polymer application

Full Transcript

a speed all right pc33 take one intro marker hey there polycasters Rob here welcome back to ask polymer the show where you send in your hashtag questions and we do our best to answer them okay our first question today comes from Marco who asks what about internationalization do I have to use an external Javascript framework or is there some specific polymer solution for that so that's a really good question and one that I get all the time uh right now we have an element that will help with internationalization uh you can check it out over here it is called I 18in message it's actually written by uh Eric bman one of our team members and used on a few of our sites and basically the way it works is you take your text you wrap the i18 message tag around your text and then you give it a message ID which is synced up with a Json file that loads different language packs so that is one solution that you can use for internationalization today it's not you know the the bulletproof perfect solution for all scenarios but it is something to get you started and we're also currently working on a new set of elements called carbon elements and our hope is that for those elements sets we'll be rolling out some internationalization solutions as well so thank you for that awesome question Marco all right our next question comes from share who asks with the emphasis on mobile can Ripple and other animations be turned off for 3G and does that matter so that's a really cool question uh for something like the paper Ripple animation you actually can turn that off on your elements if you just add a no ink attribute to the element itself it will disable the Ripple so for instance if you add that to paper button it'll turn it off uh now for something like mobile what you can do is you can use an iron media query to set up a Handler to check the screen size and if it's a smaller screen you can then remove that attribute perhaps if it's a larger screen you could add it back so that way you could you know have it on desktop maybe take it away from Mobile to get kind of Maximum performance there as always you want to be measuring your performance if something does seem like a bottleneck then yeah you know use a strategy to try and remove it so thank you share for that really awesome question all right our next question comes from Mark who asks how do you generate documentation for elements and how do you document packages so to document an element what I typically do is I start with this thing called the seed element project you can check that out over here on GitHub and what that's going to do is give you a boilerplate element as well as in the index file this thing called iron component pages and iron component pages is going to read all the comments in your element itself and generate documentation for you now there's special annotations that you have to use and you can check out this style guide over here which explains the different annotations uh but if you basically work with that project as your starting point for your new elements then you're going to get documentation basically for free it's a pretty cool setup so uh definitely check out seed element and see if that meets your needs so uh thank you Mark for sending in that really cool question okay our next question comes from Nicholas who asks how do you use CSS mixins with media queries so that is an interesting question uh right now with the current limitations of the style shimming system in a media query you can consume variables however you can't set new variables or custom properties so what you can do is use an iron media query element to check the different screen sizes and when it's a smaller screen size you can call polymer's update Styles method and actually like pass in new properties that way there's actually a GitHub issue which discusses this and shows an example of how you can work around it so you can check that out over here and you know for for working with Mixon what I can do is I can throw together a little JS bin and add that to the show description so you can see how that works there as well so thank you nickus for sending in that awesome question okay our last question comes from Jonathan who asks uh could you talk a little bit about the difference between paper list box versus paper menu so yeah uh first of all way to have an Eagle Eye Jonathan and I don't even think paper list box is in our catalog yet it is up on GitHub so you're totally on the ball the way that I understand things is paper lists box is kind of like the select element when you add a multi-attribute to it so you get you know multiple things that you could choose from perhaps you want to even choose like one or two items at the same time however the uh paper menu is sort of more of like a traditional drop down menu so that would be the difference between those two uh again thank you so much for sending in that question Jonathan so that's it for today thank you everyone who sent in those awesome questions if you yourself have a question you can ping us on a social network of your choosing at # ask polymer or leave it for us down below in the comments as always thank you so much for watching and I'll see you next time [Music] up

Original Description

Internationalization (i18n) is an important feature for any large application. Today on #AskPolymer we look at i18n solutions, element documentation, and tricks for making your mobile app animations fast! i18n-msg https://ebidel.github.io/i18n-msg/components/i18n-msg/ seed-element https://github.com/polymerelements/seed-element docs style guide http://polymerelements.github.io/style-guide/ CSS variables issue https://github.com/Polymer/polymer/issues/2149 CSS mixin *note* it turns out this is not supported. The engineer who told me it was is a liar and he should feel bad. paper-listbox https://github.com/PolymerElements/paper-listbox Subscribe to the Chrome Developers channel at http://goo.gl/LLLNvf
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Chrome for Developers · Chrome for Developers · 25 of 60

1 Polymer Performance Patterns (The Polymer Summit 2015)
Polymer Performance Patterns (The Polymer Summit 2015)
Chrome for Developers
2 Polymer Power Tools (The Polymer Summit 2015)
Polymer Power Tools (The Polymer Summit 2015)
Chrome for Developers
3 Chrome Dev Summit 2014 – Chrome Case Studies
Chrome Dev Summit 2014 – Chrome Case Studies
Chrome for Developers
4 Web Directions Code 2015 round up
Web Directions Code 2015 round up
Chrome for Developers
5 Maintainable Code - HTTP203
Maintainable Code - HTTP203
Chrome for Developers
6 iron-ajax… wat?! -- Polycasts #26
iron-ajax… wat?! -- Polycasts #26
Chrome for Developers
7 The Guardian - Supercharged
The Guardian - Supercharged
Chrome for Developers
8 ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
Chrome for Developers
9 #AskPolymer: Rob answers all the questions ever -- Polycasts #27
#AskPolymer: Rob answers all the questions ever -- Polycasts #27
Chrome for Developers
10 The Future of JavaScript - HTTP203
The Future of JavaScript - HTTP203
Chrome for Developers
11 Data Binding 101 -- Polycasts #28
Data Binding 101 -- Polycasts #28
Chrome for Developers
12 The Guardian part 2 - Supercharged
The Guardian part 2 - Supercharged
Chrome for Developers
13 The Future of Web Audio: with Chris Wilson and Chris Lowis
The Future of Web Audio: with Chris Wilson and Chris Lowis
Chrome for Developers
14 Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome for Developers
15 Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Chrome for Developers
16 #AskPolymer: How do you make the show? -- Polycasts #29
#AskPolymer: How do you make the show? -- Polycasts #29
Chrome for Developers
17 Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Chrome for Developers
18 Binding to Objects -- Polycasts #30
Binding to Objects -- Polycasts #30
Chrome for Developers
19 Player FM - Supercharged
Player FM - Supercharged
Chrome for Developers
20 Where’s the Designer? #AskPolymer -- Polycasts #31
Where’s the Designer? #AskPolymer -- Polycasts #31
Chrome for Developers
21 Jake Beats Wikipedia - HTTP203
Jake Beats Wikipedia - HTTP203
Chrome for Developers
22 Supercharged Observers! -- Polycasts #32
Supercharged Observers! -- Polycasts #32
Chrome for Developers
23 Jai's Web blog - Supercharged
Jai's Web blog - Supercharged
Chrome for Developers
24 Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Chrome for Developers
What about internationalization? #AskPolymer -- Polycasts #33
What about internationalization? #AskPolymer -- Polycasts #33
Chrome for Developers
26 Developing for Billions (Chrome Dev Summit 2015)
Developing for Billions (Chrome Dev Summit 2015)
Chrome for Developers
27 Google+ Performance Improvement Comparison
Google+ Performance Improvement Comparison
Chrome for Developers
28 Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Chrome for Developers
29 Progressive Web Apps (Chrome Dev Summit 2015)
Progressive Web Apps (Chrome Dev Summit 2015)
Chrome for Developers
30 Instant Loading with Service Workers (Chrome Dev Summit 2015)
Instant Loading with Service Workers (Chrome Dev Summit 2015)
Chrome for Developers
31 Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Chrome for Developers
32 Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Chrome for Developers
33 Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Chrome for Developers
34 Polymer - State of the Union (Chrome Dev Summit 2015)
Polymer - State of the Union (Chrome Dev Summit 2015)
Chrome for Developers
35 Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Chrome for Developers
36 Introduction to RAIL (Chrome Dev Summit 2015)
Introduction to RAIL (Chrome Dev Summit 2015)
Chrome for Developers
37 DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
Chrome for Developers
38 RAIL in the real world (Chrome Dev Summit 2015)
RAIL in the real world (Chrome Dev Summit 2015)
Chrome for Developers
39 #ChromeDevSummit talks are up - W00T! -- Polycast #34
#ChromeDevSummit talks are up - W00T! -- Polycast #34
Chrome for Developers
40 V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
Chrome for Developers
41 Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Chrome for Developers
42 Owning your performance: RAIL (Chrome Dev Summit 2015)
Owning your performance: RAIL (Chrome Dev Summit 2015)
Chrome for Developers
43 HTTP/2 101 (Chrome Dev Summit 2015)
HTTP/2 101 (Chrome Dev Summit 2015)
Chrome for Developers
44 Leadership Panel (Chrome Dev Summit 2015)
Leadership Panel (Chrome Dev Summit 2015)
Chrome for Developers
45 Build Processes, Totally Tooling Tips (S2, Ep 5)
Build Processes, Totally Tooling Tips (S2, Ep 5)
Chrome for Developers
46 Accessibility (Chrome Dev Summit 2015)
Accessibility (Chrome Dev Summit 2015)
Chrome for Developers
47 Binding to Arrays -- Polycasts #35
Binding to Arrays -- Polycasts #35
Chrome for Developers
48 HTTP2 - HTTP203
HTTP2 - HTTP203
Chrome for Developers
49 Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome for Developers
50 Call For Submissions - Supercharged
Call For Submissions - Supercharged
Chrome for Developers
51 Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Chrome for Developers
52 Testing AJAX with Web Component Tester -- Polycasts #37
Testing AJAX with Web Component Tester -- Polycasts #37
Chrome for Developers
53 Slack: Extended Xmas Special - Supercharged
Slack: Extended Xmas Special - Supercharged
Chrome for Developers
54 Browser testing with Travis & Sauce Labs -- Polycasts #38
Browser testing with Travis & Sauce Labs -- Polycasts #38
Chrome for Developers
55 Optimize for production with Vulcanize -- Polycasts #39
Optimize for production with Vulcanize -- Polycasts #39
Chrome for Developers
56 Highlights from Chrome Dev Summit 2015
Highlights from Chrome Dev Summit 2015
Chrome for Developers
57 Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome for Developers
58 Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Chrome for Developers
59 How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
Chrome for Developers
60 Colors – DevTools Tonight #0 (Pilot)
Colors – DevTools Tonight #0 (Pilot)
Chrome for Developers

Related Reads

Up next
How to Speed Up Your WordPress Website with WP Rocket ⚡Tutorial 2026
Matt Tutorials
Watch →