Skip to Content

Where are you?

You’re currently reading the second part of a four-part tutorial:

 

1. Create a Trial Account and Enable SAP Translation Hub.

2. Use SAP Web IDE to Create a Simple Fiori App and to Search for UI Texts.

3. Create a Translation Project and Translate Your Fiori App.

4. Change Your App and Start the Translation Process for Your Fiori App Again (Optional).

 

What’s this part of the tutorial about?

Now things get a little more interesting. We leave behind the preparation stuff and move on to cool things in SAP Web IDE, the development environment on SAP Cloud Platform. To make things a little easier, we’ve prepared an app that you can import straight into SAP Web IDE. The story then continues something like this:

  • Once you’ve imported the app, you add a new text to the app by leveraging the lookup capabilities of SAP Translation Hub’s suggestion service.
    Not only does this mean you can reuse existing texts, it also adds the text and ID to the properties file, which is a big help if you’re adding lots of texts.
  • You then need to put your app’s project in a Git repository – to stick with one integrated platform, we show you how to use the Git repository in SAP Cloud Platform.

 

Accessing SAP Web IDE

What You Need to Do What You See

In the navigation tree of the SAP Cloud Platform cockpit, choose Services.

 

 

 

In the Search box, enter Web.

 

 

 

Choose the SAP Web IDE tile.

Section2.1_a.png
Choose Open SAP Web IDE. Section2.1_b.png

If the automatic logon feature in SAP Cloud Identity is not active, log on with your user and password of SAP ID Service.

Note: To avoid having to log on each time, choose Remember me.

Section2.1_c.png
SAP Web IDE opens. Section2.1_d.png


Now that you’re in the development environment, it’s time to grab the app that we prepared.

Importing a Fiori Project

You can use any app for this part, but to save time, simply download our simple shop app to get started in no time at all.

What You Need to Do What You See

Open the mysimpleshop folder on GitHub.

 

Choose View Raw and save the my_simple_shop.zip file in a folder that you will be able to locate easily. You’ll need to navigate to this folder in the next step.

Section2.2.png
In SAP Web IDE, right-click Local, and choose Import -> From File System. Section2.2_a.png

Do the following:

  1. Browse to the my_simple_shop.zipfile that you downloaded in the first step in this section.
  2. Leave the default folder in which SAP Web IDE imports the project (/My_simple_shop in this example), or enter a different folder name.
  3. Ensure that the Extract Archive checkbox is selected.

    To continue, choose OK.
Section2.2_b.png

Open theMy_simple_shop project that you imported in the previous step and locate the localindex.html file in the file structure on the left.

 

 

Right-click thelocalindex.html file, and choose Run –> Run with Mock Data.

Section2.2_c.png

A Fiori Web shop UI appears with some texts that you are going to translate in the subsequent exercises.

 

 

 

Note: You will translate the field labels (Image,Name, Description, and so on), not the texts that describe the actual content of the Web shop, such as Quality cables for notebooks and projects in this example.

Section2.2_d.png

Drill down to the product details by choosing any product in the list.

 

The field labels (Product ID, Description, and so on) that you see in the screenshot on the right are also texts that you will translate.

Section2.2_e.png

You have now imported a sample app into SAP Web IDE. You’re now going to add a text by using SAP Translation Hub’s suggestion service.

Use Suggestion Service to Add New UI Text

What You Need to Do What You See
Before you translate the texts in the app, you would like to add a title called List of Products to the area highlighted yellow in the adjacent screenshot. Section2.3_a.png

Switch to the browser tab in which SAP Web IDE is open, and expand the view folder.

Double click

the S2_ProductList.view.xml file, and search for <Page id=”productListPage” title=””

Section2.3_b.png

Place the cursor between the two speech marks (“”).

To access the suggestion service, choose CTRL+Space.

Section2.3_c.png

Start typing List of Produ.

The texts that appear come from the multilingual text repository.

 

 

 

Note: If no texts appear in the suggestion service box, go to the optional step two rows lower down this table of steps.

Section2.3_d.png

Select List of Products.

 

A new key is added to the XML file, and a new entry is added to the properties file.

 

Save the S2_ProductList.view.xml file.

/wp-content/uploads/2016/05/section2_3_e_947433.png

Optional: If the suggestion service does not work, enter the following: {i18n>List_of_Products_345925}

 

 

 

You must add this text to the properties file, too (see optional step in next row).

To verify that the new text has been added to the properties file, expand the i18n folder, and open the i18n.properties file.

 

 

 

Optional: If you were not able to use the suggestion service to add List of Products, add the following to the end of the end of the i18n.properties file:

 

 

# YMSI:345925(Basis(BC))

List_of_Products_345925=List of Products

Section2.3_g.png
Save both changed files. Section2.3_h.png

To check whether the text has been added to the UI correctly, refresh the window in which you ran the app with mock data.

If you closed that window, choose the Run button in SAP Web IDE.

Section2.3_i.png

Note: Due to cache issues with Google Chrome, the new text is not always visible in the app preview after you refresh the window.

To solve this problem, carry out the steps explained in the adjacent cell:

  1. In the top-right corner of the browser window, open the Chrome menu (button with horizontal bars).
  2. Choose History and recent tabs -> History.
  3. Choose Clear browsing data.
    A dialog box appears.
  4. In the drop-down menu, select how much history you want to delete; to clear your entire browsing history and cache, select the beginning of time.
  5. Check the boxes for the data you want Chrome to clear; at the very least, select Browsing history.
  6. Choose Clear browsing data.

Now that you’ve added a new text to the app, you need to deploy the app to SAP Cloud platform and push the app files to the Git repository of SAP Cloud Platform.

Deploying Your App and Pushing Project to Git Repository

What You Need to Do What You See
Deploy your app to SAP Cloud Platform by right-clicking your project, and by choosing Deploy –> Deploy to SAP Cloud Platform. Section2.4_a.png
Log in to SAP Cloud Platform. Section2.4_b.png
Check the

  • The Deploy a new application radio button is selected
  • The name of the application is mysimpleshop

 

 

 

Choose Deploy.

Section2.4_c.png

A message confirming the successful deployment appears.

 

 

 

Choose Open the application’s page in the SAP Cloud Platform cockpit.

Section2.4_d.png

To manage the application’s source code in Git, you connect your project to the Git repository on SAP Cloud Platform. To do this, you need the URL for your application in the Git repository.

Choose Versioning on the left and copy the Git repository URL.

 

 

 

Note: Although you could use the URL to edit your app in any Git client, during the exercises, you always edit the app online in SAP Web IDE.

 

 

You can also use the Versioning section to check when your Git repository was updated. You can check the versions of your app at any time during the exercises to verify that a particular step was carried out correctly, such as translations being updated.

Section2.4_e.png
Optional: As an alternative to using the Versioning section to see what is happening with your app files in the Git repository, you can view the contents of the Git repository by using the Git service in the service SAP Cloud Platform cockpit. Section2.4_e1.png
Go back to SAP WEB IDE and choose the Close button. Section2.4_f.png

To connect your project to the SAP Cloud Platform Git repository, you initialize the local repository.

To do this, right-click your project and choose Git -> Initialize Local Repository.

Section2.4_g.png

In the Configure Git Repository window, paste the URL that you copied from the application’s page in the SAP Cloud Platform cockpit.

 

Choose OK.

/wp-content/uploads/2016/05/section2_4_h_947477.png
Select your project in the left frame and open the Git pane. /wp-content/uploads/2016/05/section2_4_i_947478.png
To be able to work with the content in the remote repository, you must first pull the content structure from the remote repository. /wp-content/uploads/2016/05/section2_4_j_947479.png

Log on to the Git repository with your SAP ID user and password.

To avoid having to log on in the future, select Remember Me, and choose OK.

Section2.4_k.png

A message confirms that the content structure was pulled successfully.

Note: The message appears for only a few seconds.

/wp-content/uploads/2016/05/section2_4_l_947481.png

Select the Stage All checkbox and write a short description for the commit.

Choose Commit and Push, and select Remote Branch.

Section2.4_m.png
Select origin/master and choose OK. Section2.4_n.png

A message confirms that the app content was pushed successfully.

Note: The message appears for only a few seconds.

Section2.4_o.png

Optional: To verify that the app content was pushed to the Git repository, check the versions of the HTML5 app in SAP Cloud Platform cockpit.

 

You should see at least two commits here.

Section2.4_p.png

The Bottom Line

That’s it for this part of the tutorial. You’ve imported a ready-made app into SAP Web IDE, added a text – complete with internationalization steps – to the app, and pushed the content of the app to the Git repository of SAP Cloud Platform.

Now it’s time to translate the app in Part 3: Create a Translation Project and Translate Your Fiori App.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply