logo

NJP

MGOPW

Maria Gabriela Ochoa Perez Waechter

ServiceNow developer MVP

ServiceNow Inc.

Conference Sessions

K22

Five things I wish I knew before attempting to localize my scoped application

CCB1128-K22

## Transcript X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:0 [MUSIC PLAYING] Hello, everyone, and welcome to five things I wish I knew before attempting to localize my scope application. My name is Maria Gabriela Ochoa Perez Waechter. My pronouns are she, her, and I'm a 2022 and 2021 ServiceNow developer MVP. Hi, everyone. I'm Jesalyn. I'm a ServiceNow developer, and I'm looking forward to sharing what we've learned about localization. So before we go further into the presentation, we thought it would be helpful to go back to the basics real quick. We're going to be using some terms throughout the session, and we want to make sure everyone is familiar with them. So what is the difference between localization and translation? Localization is making an application adaptable to specific regions without impacting functionality. This means your application can show the target language, currency, date formats for that region. Translation refers to changing source text into another language. You may be thinking can't ServiceNow do this for us. The language pack plug-ins that ServiceNow provides only cover out-of-box strings. This means that anything custom that you add or you modify to the system needs to be localized by yourself, and in a scoped application, that's everything. There's a couple of different ways you can localize your app. You can do it by hand or by machine, such as Google Translate. We're going to be focusing on the manual approach because that's what we decided to do. Here's some tools to help us localize our application. We recommend using them since they made the entire process a lot easier. The out-of-the-box tools that are available are the Translation Prefix System Property. It places a prefix-like message before each string to tell you which table a string is on, and that helps with debugging and identifying translation gaps. And then there's the Translate and Learn System Property that will automatically create records in the applicable translation table for any strings that are missing translations. So what you basically end up doing is you click through your entire application, and it's going to pull things like table names, options for the fields and automatically create translation records for you in the corresponding tables. Another great tool that is available online is the FetchCode project on the ServiceNow share. We used it to help us identify hard-coded strings in our script includes, in our business rules widgets, and any other place that has a script field. We use this to search for word code that is, in our instance, in a large scoped application with lots of legacy code. It's likely that you don't know where code exists or what it's doing, and it made it really easy to search for everything. Next, we use the website called Crowdin in order to obtain our translations of our strains. We basically compiled everything into a spreadsheet, and we uploaded that into the Crowdin website, where we were able to get quotes from multiple different vendors and select who we wanted to work with from there. And finally, we're going to have all of these resources and many more links in our GitHub repo that's available at the end of this presentation. Now that we've covered the basics and some helpful tools, it's time to learn about the five things that I wish I knew before attempting to localize my scope application. We've broken up the process into five steps, and the first step happens before you do anything. You need to plan your localization strategy. This means figuring out details like what language you're going to support, how you're going to source your translations, and many others. In our case, we decided to focus on Spanish, French, and German since that's what our customers currently requested. There's a few options for sourcing translations, like Jesalyn said. You can use machine learning, such as Google Translate, or you can use experts and native speakers in order to translate by hand. Our team had native Spanish and French speakers available to us, so we only had to figure out plans for German translations, which is where we went with a Crowdin tool. Now that you're ready to start because you have everything strategized. You can go ahead and turn on the language plug-in. During this stage of the process, you really want to focus on finding those missing translations. This is where you want to use the Translate and Learn System Property that we mentioned earlier. This property will create initial translation records for you because ServiceNow will only show translated text if there's a translation record for that string on any of the five tables. This property will create the records for you, so what we recommend doing is turning the property on and then clicking through everything in your application. Going module by module, visiting every form, every list, every widget, every portal page, and so on. And through this method, we were able to generate over 100 records of translations that we need to source. Another thing to focus on is the Display Translation Prefix System Property. What this one will do is it will show you if you have hard coded strings in your instance. Because if there's no prefix, which is what shows you what table a string is from. If there's no prefix, then that means that the string is hard coded, and that is not ideal. And what you need to do for that is convert that into a translatable way. So then ServiceNow knows to translate it, and it won't stay hard coded. And for that, what we recommend doing in the next phase, stage three, is Establishing Design and Development standards. So in order to make sure that everything is scalable and translatable, you want to have standards. So this means not hard coding any strings, and you want to be using the appropriate gs.getMessage depending on if it's the server or the client or even in a portal widget. So the best way to do that is to have gs.getMessage is to structure it by using a system-like message. So the general example you've seen with gs.getMessage is gs.getMessage hello world. So, hello world is what's displayed to the screen or the user. Rather than using hello world, we recommend structuring your gs.getMessage in a system-like way. So the key for the input to gs.getMessage would be a system-like description such as widget header text. Widget header text would then be your key, and your value for the record on the messages table could be hello world. So then, you're still showing the same output of hello world, but you're just structuring it in a way that makes it easier to maintain and to code. Because now, if you have it structured like that, where you're showing widget header text, then when you are doing your search for missing translations with the display translation prefix system property. When you're searching around your instance, and you see the output of widget header text, then you know that you don't have the appropriate translation record. Because it's showing that system description rather than showing the hello world that you would expect to see. So to sum it all up, static strings are bad, and you want to make sure you're always wrapping everything in your gs.getMessage. With everything localized, it's time to test all the hard work that you've done so far. We don't have a well-defined testing plan yet, partly since we haven't reached the stage ourselves. However, what we have done is taken a look at everything in our application to see how it looks when things are translated. Different languages are going to have different sizing requirements compared to English. So what looks good in the English version of the UI might appear cramped or overflowing in the translated UI. So, for example, the word new is three letters long in English, but it's nine letters long in French. This is something to be mindful of and keep in your mind as you go through this process, especially when users are zoomed into their browsers, or they have a larger default font size. Another thing that we plan to do here is have our customers try to navigate our application in English and then in the target language like French, using our service portal as an example. Our goal is to verify that our customers can navigate and use the portal functionality in the same way in English and French. If our customers are unable to use the French version of the portal, for whatever reason, that gets us feedback on what needs to be reworked. And now, great job. It's the future now. The localization implementation has been deployed, and now you need to maintain it. So like testing, we don't have a well-defined maintenance plan just yet. But we are planning on scoping that out and figuring out exactly what's required. One of the things to keep in mind is that as new content and features get added to the app, localization needs to be considered. Code reviews should be checking that strings aren't hard coded and that you have correspondent translation strings in your system for any new updates that are getting added, for example. A good thing about making sure that you're not hard coding strings and wrapping everything in the appropriate gs.getMessage, in your scripts is that this makes maintenance of your strings a lot easier. Whenever you want to change the wording of a message, you no longer need to edit your script includes or business rules. You can instead update the value of the translation record for that key which is a beta change. And finally, we'd like to thank you for listening to our presentation on localization. I hope that this has helped you all get started. If you want to get more resources, you should check out our GitHub repo linked down below, which is going to have a lot more information and links. You should also check out our blog post on WomenNow.dev. We're going to go way more in-depth on what we covered today, and we're going to have code samples that you can reference. You should also come hang out with us at sndevs.com, which is our community Slack server, where we all like to hang out and talk about ServiceNow and ServiceNow related topics. Thank you very much, and have a good day. [MUSIC PLAYING]

K22

(ノ◕ヮ◕)ノ*:・゚✧ Hack your environment to work for you ✶✩

CCB1120-K22

## Transcript X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:0 [MUSIC PLAYING] Hello, everybody, and welcome to hack your environment to work for you. My name is Maria Gabriela Ochoa Perez Waechter. Some of you may know me as MGOPW, and my pronouns are she/her. I am a 2022, 2021 ServiceNow Developer MVP. And I've got ADHD combined, PTSD, generalized anxiety disorder, and major depression recurrent with stress. I'm a Venezuelan-American immigrant, and I'm part of the LGBTQIA+ community. We're getting a little bit personal in this session today. So I wanted to get all of that out of the way. And I wanted to first share with you a quote that really helped me realize some things about myself. This is from the Disability Science Review, but developmental disabilities are not a disease. They are a mismatch between a person's capabilities and the requirements of their life situation and culture. It helped me realize that my ADHD is really only a problem because I live in a society where I'm expected to sit for eight hours straight and work, and I just can't do that. So it's story time. When I was young, I really struggled in school, and I had no idea why. I got perfect grades, but I could never focus on any one thing. And I could never make my mind up about what major I wanted to be in. I switched majors because I love doing everything, and I couldn't stick to one or the other. I went between advertising, psychology. My dad always tried to get me to do art, but I wanted to make money, so I want computer science in the end. When I was part of the computer science program at my school, I looked around me and I saw just a bunch of men, who could sit there and stare into the matrix and pull out lines of code and somehow just be able to work for hours on end, when I couldn't even focus for 30 minutes at a time. It took me a while to get everything figured out. I went to a couple of doctors and a whole bunch of therapy. And I was finally able to accept myself for who I am and really keep working on my own mental health. Somewhere through that, I ended up getting into a car accident, and I'm still going to school. One day, I'll finish it. And then I ended up getting to ServiceNow. I finally found a place where I could do all the things I wanted to do, and I could do them all at once. I could get to interact with people. I was getting to be creative to the Service Portal, and I got to write code like I had always thought I couldn't do. But how did I get there? A lot of coping mechanisms or alternatively, how the Job Accommodations Network calls them accommodations. Now there's a lot of things that you need to consider, and you should work with your boss or your manager when you do this. But you have to figure out what parts you're struggling in your career with. And I've been very lucky to have had some amazing mentors and role models in my career that have been willing to help me out. One of the hardest things that I just cannot do is prioritize tasks. I'm really great at taking notes, so I'm really great at paying attention and retaining information. But I don't know where to put it. I don't know how to organize it, and I don't know what needs to come first. So I've always asked my managers for help, figuring out which of these 37 tasks need to be done first. Other stuff that has worked for me in the past is being provided a structured breaks, being provided private workspace time, minimizing random things that I have to do as part of my job. To focus on specific things and specific blocks of time has really helped me out. An uninterrupted work time with no meetings has been just one of the biggest and best things ever. You can also do to-do lists or have meetings at the start of the week in order to prioritize the rest of your week and other assistive technology, like pomodoro timers are a lifesaver. They're little cubes or you can even have digital timers that you do pomodoro sprints with. So it could be 30 minutes of work and then a 5-minute break, and then 30 minutes of work and then a 5-minute break. And this has really helped me out because I've been able to just really hard focus on just working, and then I've been able to disconnect for a little bit and then be able to reconnect. And I found that I have been incredibly productive during those pomodoro times. Now there's something else that I ended up figuring out, and that takes me to this code. It's a lot of code, isn't it? It's too much for me sometimes, and this is only a third or a fourth of the final length of the script. And while I was working on this, it was awful because I just have to kept-- I just kept coming back and then leaving, and then coming back and leaving. And every time that I had to get my mind back in the coding mindset and back into the code, it took me at least 30 minutes to really figure out what the heck was going on. Because there's so many words on the screen, all of it makes sense individually to me, but it all doesn't make sense at the same time. So I started looking around because there had to be some way to figure this out. Somebody had had to figured something out with this by now. So that made me turn to Visual Studio Code. It's a great text editor. I highly recommend you use it. There's a bunch of awesome plug-ins, and one of them is called Highlight. Highlight lets you use regex to highlight different things in your code. The suite's called Highlight. So I used it and the help of some of my really good friends, thank you guys so much, to highlight previous, current, and my log statements and change their colors. You can make them be really obvious. You can use background colors. You can change the color, the font way. You can change the color looks on the sidebar, a whole bunch of stuff, and it will just do it automatically for you when you load your script. And it basically turns this giant block of text into something a lot more legible for me. To you, this might not make sense and in my look, even worse. But to me, it's really helped me out because I'm now able to-- well, first, I can look at the entire line of code. And that log line in line 4, it doesn't register in my brain because it's so close to the background color. But I know it's there when I need to reference it. So suddenly, the size of it looks a bit smaller. I also discovered that I could use emoji inside of ServiceNow scripts. So I now use emojis to figure out logic. With this script, I was working on a lot of previous and current objects inside of a business rule, and I kept getting confused about the if and else-if statements because they had to be compared to each other. One had to be empty. One had to be non-empty, and there was a whole bunch of different cases where I needed to do something specific according to the state of previous and current. So I created these little comments at outlines, where it tells me if it's two X's, I know they both don't exist. And if it's an X and a check mark, I know that previous exists, it doesn't exist, and then current exists, and so on and so forth. Because I don't know why, in my mind, I just cannot read if nil or dot nil and remember the meaning of it right away. It always takes me a second to read logic that out in my brain, and I've realized that that was just wasting a whole bunch of time. So when we compare the two, one of them might look better to you. One of them looks way better to me, and that's what this whole session's been about. It's been about you working to find what works for you, and what works for you may not work for me, and vice versa. So I highly encourage you all to take a look at the Job Accommodations Network. A lot of us don't put a term to the struggles that we face day in and day out. Some of us choose to go with mental health therapy, and others choose to find other methods of treatment. But we all end up having our own individual struggles. Even if it looks like nobody else around you is struggling, trust me, they are. Look up imposter syndrome. And then look up the Job Accommodations Network to really figure out how you can help yourself succeed because there's only going to be one person invested in you, and that's going to be yourself. And you need to take that time for yourself. One last thing that I wanted to mention is something that a lot of people come up to me and say is that they can't find any jobs that are looking for people with their experience. They don't know how to get into the field. And they don't want to apply to this job because they feel like they'll be rejected. But what I want you to know is that I have never applied for a job that I was fully perfect for. I have never met the job requirements. They always asked for a degree, which I don't have. They always ask for 20 some years of experience for an entry level job, which nobody has. And what you really just need to do is just apply. You just need to do it. Don't let your dreams be dreams. Just do it. Yesterday, you said today, do it, and just join us over at SNDevs, where we all love to hang out and help each other. We're the largest independent ServiceNow community. You can find the link on the slide right behind me. And finally, make sure you go check out WomenNow.Dev. I'm going to be posting a blog post going further into my experiences, the specific accommodations that have really helped me out throughout my career. And I'm going to be posting a lot more resources that you can tap into and other blog posts to really help you in your journey in getting started or wherever you might be on helping yourself succeed. So thank you so much for watching. And I hope you have a wonderful rest of your day. [MUSIC PLAYING]