=== Jack is now known as Guest63657 === marrusl is now known as marrusl_afk === marrusl_afk is now known as marrusl === yofel_ is now known as yofel [07:32] p === Quintasan_ is now known as Quintasan === davidcalle_ is now known as davidcalle [11:18] hi [11:18] anyone? [11:19] help [11:19] cuc === jbernard_ is now known as jbernard [15:14] Hello [16:59] hello everyone, Ubuntu App Developer Week is starting in a few minutes! [16:59] hellp dpm [16:59] hello :) [16:59] o/ [17:00] yofel: surprise to see you here :/ [17:00] :P [17:00] :) [17:01] * DraZoro says hi all [17:01] I think its time :/ [17:01] !time [17:02] let's wait for a few minutes for the first speaker to turn up... [17:02] c2tarun: uh... lol? [17:03] sorry I'm late [17:03] !time [17:03] :P [17:04] jryannel, no worries [17:05] Everyone welcome the first speaker of today. It's Qt's jryannel, who's going to talk about Qt Quick: Elements/Animations/States [17:05] jryannel: hello :) [17:06] Hi all, [17:06] Before we do, plase download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-composing-uis.pdf [17:06] wait a sec, why hasnt Classbot +m'd the place yet? shouldn't it be doing that? [17:07] Can I continue? [17:08] There are also the examples/labs available at: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/addons/addon-qml-composing-uis.zip [17:09] This is part of our Qt Quick Essentials Training Material. Available to download from: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition === basso_ is now known as basso [17:10] We skip the first slides (we covered it roughtly yesterday) and go ahead to slide 21 (Anchors) [17:10] We learned yesterday we can position elements by x, y and width/height. [17:11] Often we want to layout elements [17:11] this is done with anchors [17:11] A anchors is another contract [17:12] It says roughly this element shall always be on the left site of the other element [17:12] anchors.left: other.left [17:12] So also when you move one element the other will always follow [17:13] You have top/bottom/left/right anchors [17:13] and also horizontalCenter/verticalCenter [17:13] Slide 22:Anchors [17:13] This is an example how to use anchors [17:14] remember you can reference other elements by id [17:14] anchors.centerIn: rectangle1 [17:14] centerIn centers rectangle1 in this element (width and height is not changed) [17:15] We jump to slide 25: Margins === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Qt Quick: Elements/Animations/States - Instructors: jryannel [17:16] An anchors fixes on eelement to another element. [17:16] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [17:17] For reference: We use the slides at: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition [17:17] Called; Composing User Interfaces [17:17] We are on slide 25 [17:17] A margin provides some space between the anchoring [17:17] Slide: 26 [17:18] Here we see a rectangle containing 2 elements (image + text) [17:18] image and text shall be vertical centered and have some spacing between [17:19] The image is anchored on the left side of the parent's left side [17:19] and has on the left side 1/16th of space of the width of the parent [17:19] and sure the image is vertical centered [17:20] similar applies to the text. But instead of anchored to the parent it's anchored to the image [17:20] The anchors.baseline is important for text to anchors according to the textbaseline [17:21] Anchors are also described in more detail at: http://doc.qt.nokia.com/4.7-snapshot/qml-anchor-layout.html#anchor-layout [17:21] So besides of positioning elements by x,y we can also anchors them with margins. [17:22] Often you want to anchor element in a row or column or a grid. For this we have spezialised elements [17:23] They are called Column, Row, Grid [17:23] They are helper elements to avoid writing common code [17:24] See http://doc.qt.nokia.com/4.7-snapshot/qml-positioners.html for more information [17:25] anchors can be used to produce very powerful ui and also felxible from the screen dimensions [17:26] Okay. Let's go to the next module. We jump over module user interaction and go direct to states [17:26] Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-states-transitions.pdf [17:27] A state describes your ui in different "phases" [17:27] E.g. in simple terms it defines how properties values shall be in these different phases [17:28] If you problem downloading: http://qt.nokia.com/developer/learning/online/training/materials/qt-essentials-qt-quick-edition [17:28] Then choose: States and Transitions [17:29] So think about a stop and a go light. Both are represented by a rectangle [17:29] See 6 [17:29] Slide Nr. 6 [17:30] in a "go" state we want one rectangle green in the "stop" state we want the other rectangle red. [17:30] Slide: 7 [17:31] We describe the states with the states property. [17:31] Which is an array of State elements [17:31] a property array is marked with [ ] [17:32] state go has the name "go" and state "stop" is names stop. [17:32] Both describe changes to properties to elements declared earlier [17:32] "stop" state changes the color of stop_light to red [17:32] and go_light's color to "black" [17:33] How to switch between the states? [17:33] use the state property and assign the state name [17:33] Slide: 8 [17:33] Setting the State [17:34] each element has a state property and a states property [17:34] states is the array of states and state contains the name of the current state. [17:35] onClicked: parent.state == "stop" ? parent.state = "go" : parent.state = "stop" [17:35] onClicked is a clicked handler from the mousearea. [17:35] A mousearea is an area which received mouse clicks, presses, releases... [17:36] we first ask for the current state and if it's "stop" we change it to "go". [17:36] Qt Quick recognizes the change and updates the ui based on the state [17:37] very simple [17:37] We jump to slide: 12 [17:37] Another example, little bit more complicated. [17:38] Qe have a text in a rectangle [17:38] Additional we have a image (clear_button) which is clickable through the mousearea. [17:38] When the image is clicked the text of the text_field is set to "" [17:39] Slide: 13 [17:39] we define 2 states "with text" and "without text" [17:40] "with text" shall be active when the text_field is NOT empty [17:40] the "without text" shall be active when text_field is empty [17:42] Based on the property change notification which allows the property binding "when" is evaluated everytime the text changes [17:42] Side note: A text element will only accept input when it's focused. [17:43] This can be done by clicking in the TextInput or requesting focus with "focus : true" [17:43] When going from one state to another we have a state transition [17:44] State A -> (Transition) -> State B [17:44] Slide: 16 (Transition) [17:45] The red button changes it's color to black via a transition. [17:45] This transition in this case shall be a color animation. [17:45] (Same applies to the black/green button our go button) [17:46] Slide: 17 [17:46] Remember we have the states "go" and "stop" in an earlier example [17:47] We add transitions with the transitions [ ] array property [17:47] Each Transition element describes a transition from one state to another state [17:47] from, to describe when transition is called [17:48] Inside we use an animation (more about animations later) [17:48] so States -> Transitions -> Animations [17:48] We will see animations can also be used standalone and in other situations. [17:49] Let's leave this module and go to: QML Animations [17:49] Please download: http://get.qt.nokia.com/training/QtQuickforCppDevelopers/slides/qml-animations.pdf [17:49] I hope you all have flatrates :_) [17:50] An animation generally describes a property change according to a easing curve and duration. [17:51] So instead for example an elements position shall be changes from x:0 to x:100 it shall not go immediately [17:51] It should go in a defined way from 0 to 100 in maybe 1second and first a little bit faster and then slower. [17:52] There are 10 minutes remaining in the current session. [17:52] Slide: 6 in the qml-animations.pdf titled "Number Animations" [17:53] We have in general NumberAnimation, ColorAnimations, RotationAnimations and PropertyAnimations [17:54] We use here: NumberAnimation on x { .... } [17:54] Means it will animate x from 0 to 150 in 1 sec (1000msecs) [17:55] This will done automatically when the component (qml file) is loaded [17:55] Slide 8: PropertAnimations [17:56] Here we use an animation as a standalone animation. We need to specify the target and which properties we want to animate. with running: true you specify it shall run when the component is loaded. [17:57] There are 5 minutes remaining in the current session. [17:57] If you would give the animation an id (e.g. id: anim ) you could also start it with anim.start() [17:57] You can find more about Animations and Transitions at: http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeanimation.html [17:58] I think this it it for now. I will make a 10min break and be back with the next session [17:59] Thanks for listening :) === tubadaz is now known as tubadaz_away === tubadaz_away is now known as tubadaz === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Qt Quick: Rapid prototyping - Instructors: jryannel [18:02] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [18:10] Before I continue on rapid prototyping... some remarks to animations [18:10] There are several ways to use animtions: [18:10] * Animation on [18:11] * Animation { } // standalone [18:11] * Animation during a state transition [18:12] * Behavior on // when property changes than always with the specified animation [18:12] You can nest animations with ParallelAnimation and Sequential Animation. [18:13] There is also a PauseAnimation, which waits some time before continue with the next animation in a group [18:13] IMPORTANT!!: If an element is anchored for example on the left and right, x can't be animated!! [18:14] anchoring is stronger!! [18:14] if an element is anchored on left and right, sure y can be animated and also the height. but not the width and x [18:16] All of this is available as a 5 1/2 hour talk here: http://qt.nokia.com/developer/learning/online/training/training-day-at-developer-days-2010 [18:16] Just make yourself a nice video evening instead of watching lord of the rings [18:16] Coming to "Qt Quick Prototyping" [18:17] Please have a look at: http://qt.nokia.com/developer/learning/online/talks/developerdays2010/tech-talks/qt-quick-rapid-user-interface-prototyping [18:18] Sorry I planned to have a screen sharing available. I hope at least some of you can watch the video [18:18] Anyway I will explain about the thoughts behind... [18:19] Qt Quick was designed to bridge the gap between "designers" and "developers" [18:20] In a normal design driven project you have [18:20] designers, which think about the user interaction, graphics and nowadays animation (e.g. motions) [18:21] Then they use tools like Flash or paper or PhotoShop to sketch the ui. [18:21] Present beautiful design to their bosses and then ... [18:21] They throw these design to the c++ developer and ask them to implement this. [18:22] Sure the result will be miles away from the the sketch. It's a different technology maybe even different HW on embedded [18:23] Qt Quick allows designers early on to work with the same technologies as all the other developers [18:23] Sure these kind of designers should now how to work e.g. with HTML/JavaScript of Flash/ActionScript. For them it's pretty easy to come to Qt Quick [18:24] The result is that at any time developers and designers work on the same code base and it's easy to sketch a first ui prototype ... [18:25] and then the prototype goes over nicely into production code [18:26] By this you can shorten the time to market but also ensure the that the UI is really that what someone asked for. Pixelperfect [18:27] Qt Quick is fast to code. So that you can create many different prototypes easily and then just ask you users, which one they like best [18:27] Another aspect id that the ui code is cleanly seprated from the c++ code. [18:28] This allows you to unit test your models and business logic and heavy lifting... [18:28] and push a simple and clean qml API towards the ui developers [18:29] Qt Creator contains a design mode, which allows you to drag-n-drop ui elements (and your custom components) on a surface to sketch your ui [18:30] When you are in a qml file hit the button on the left "Design" [18:30] in Qt Creator [18:31] Here you can create a first sketch. But finally you want to switch to your code (editor) to make the more complicated stuff [18:31] So an interaction designer creates "wireframes" e.g. like on http://balsamiq.com/ [18:32] A graphics designer makes nice graphics to the wireframe, e.g. with photoshop, gimp, inkscape, ... [18:33] A motion designer thinks about how ui elements should be animated. [18:33] This is currently how I see designers. I'm not a designer I'm a programmer and I always wondered how they work === tubadaz is now known as tubadaz_away [18:35] We have material for designers ready at: http://qt.nokia.com/developer/learning/online/training/materials/qt-quick-for-designers [18:35] Especially module 6 talks about the different designer roles. [18:36] If you target a UI different from a standard desktop UI you want to have a design affine person in your team. [18:36] Especially with Qt Quick. This makes it really efficient. [18:37] If you target a standard desktop UI you want to create a set of standard UI elements or use/extend the elements produce by the Qt Components project [18:37] See https://qt.gitorious.org/qt-components [18:39] I posted this link already yesterday: http://labs.qt.nokia.com/2011/03/10/qml-components-for-desktop/ [18:39] When I prototype a UI I always start with rectangles [18:40] I normally use black background and white borders. [18:40] Just make sure you get the dimensions right. Maybe add some text to label an element [18:40] Then concentrate on the application logic [18:41] E.g. when I press here what should be happen? [18:41] At then end you look into the animations. [18:41] When something changes, then how. Should it fade (animation on opacity), should it fly in (animation on x) === tubadaz_away is now known as tubadaz [18:42] Should it fly and fade (parallel animation on opacity and x) [18:43] You should extract components early on (e.g. mybutton, mytextedit, mycheckbox, etc... [18:43] Then you concentrate on the more details and bring in the graphics, colors, gradients, etc... [18:44] Make sure you get the structure right. give application wide used elements a good id. [18:45] Mark internal properties with '_ [18:46] Try to avoid to be to dependent on your c++ backend, I use a bool _debug property to guard sometimes those dependencies [18:46] Try not to create a reusable component which can be reused in all projects in the future. [18:47] Designers think more in reuse by copy. Just make the element work for your needs. Qt Quick can be fast adapted anyway [18:47] I guess that's it is for now. Any questions? [18:49] Take care and hope you enjoined this lengthy talk :) [18:49] Ohh, one link at the end [18:50] https://gitorious.org/qtmediahub, a XMBC (MediaCenter) clone in qt [18:50] And https://gitorious.org/qmlshowcase. [18:51] qmlshowcase was produced for a customer in one afternoon! Check it out [18:52] There are 10 minutes remaining in the current session. [18:57] There are 5 minutes remaining in the current session. [18:59] Thanks jryannel for this Qt Quick marathon as a great starter for the day! Next up: mterry will tell us about Rapid Application Development with a tool you can never get enough of: Quickly! [18:59] yay [18:59] Just real quick: I have notes here if you're interested: https://wiki.ubuntu.com/Quickly/AppDeveloperWeek11.04 [18:59] I'll add a link to the meeting logs there after the fact too [19:00] So, I'm Michael Terry, a maintainer of Quickly [19:00] https://wiki.ubuntu.com/Quickly [19:00] Quickly is a template-based system for writing applications [19:00] quickly, easily, and hopefully fun [19:01] At it's heart, it's just a system of templates with boilerplate code and a few commands [19:01] But all the templates are currently Ubuntu-focused, so that's where it gets the most attention [19:01] Each template makes opinionated choices for you, so the app author can just focus on writing their app === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Rapid App Development with Quickly - Instructors: mterry [19:02] We try to give him/her the recommended technologies by default [19:02] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [19:02] oh, whoops [19:02] well, the logs might not have that starting part [19:03] Quickly in Ubuntu 10.10 has three templates: ubuntu-application, ubuntu-cli, and ubuntu-pygame [19:03] In Ubuntu 11.04, we're adding a new template, ubuntu-flash-game [19:03] A new command "submitubuntu" which helps get your app into the Software Center [19:03] And we've redesigned the project layouts a bit [19:04] I'll note when I'm talking if something applies only to the 11.04 version or not [19:04] If anyone has any questions as I go through this, please let me know in the classroom [19:04] classroom-chat that is [19:04] So today, I'm just going to give a bit of an overview for how to use Quickly [19:04] And what it can do [19:05] It's simple enough to get started. Just "sudo apt-get install quickly" [19:05] This will install a bunch of packages, which are development tools and documentation [19:05] But most importantly, it will install Quickly :) [19:06] Now I'll show you how to create a little throw-away app we can practice on here [19:06] "quickly create ubuntu-application test-project" [19:06] This will create a new directory "test-project", put a lot of boilerplate in there, and open your new project [19:06] You'll see that a window and some widgets and dialogs have been created for you [19:07] That's part of the boilerplate I mentioned before [19:07] You can customize this as much as you want, but Quickly gives you something to hit the ground running with [19:07] Now you want to enter your project directory: "cd test-project" [19:08] And here, if you typed "quickly tutorial" you would get a nice tutorial about how to make changes in the project you've just created [19:08] That's a good command to note for later [19:08] But I'm going to move on and explain some of that myself [19:08] Though the tutorial is valuable, and you should consider running through it later [19:08] So the first thing you're likely to want to change is how the app looks [19:09] In your project directory, you can type "quickly design" [19:09] And Glade will open up [19:09] Glade is a tool that lets you edit GTK interfaces by clicking around [19:09] Kinda like Visual Basic, but without any of the code elements [19:09] Glade by itself doesn't integrate with code [19:10] But Quickly matches them up for you [19:10] * mterry pauses for a sec, any questions? [19:11] OK, so let's talk a bit about Glade. If you're not familiar with it, it can be a bit intimidating [19:11] You've got your "tool palette" of widgets on the left [19:11] The middle is where you see what you're building [19:11] And the right is where you can select widgets from the widget tree or edit the currently selected widget [19:11] If you just click directly in the middle on the widget you want, it will be selected [19:11] Or if you find it in the widget tree in the upper right [19:12] In GTK, widgets are layed out in boxes, either horizontal (HBox) or vertical (VBox) [19:12] So you first create a box, then add widgets to it. And you can next boxes for more complicated layouts [19:13] Once you add a widget to a box, you can change its position in the box by going to the Packing tab in its properties box in the bottom right [19:13] There you'll also be able to change how any widget is given space [19:13] You can see the Expand and Fill properties [19:13] Most things start taking up all the space they can, but that's not always the effect you want [19:14] Those are common properties to adjust to get the layout you want === AndrewMC is now known as Guest80546 [19:14] Another thing to note is that when adding icons or menu items, you often want to use stock items where possible. That will use the correctly themed icon and automatically add translated text where appropriate === Guest80546 is now known as AndrewMC [19:15] Speaking of translations, you can choose translation options for any label in the properties box (like whether it is translated or to leave comments for the translator) [19:15] OK, enough Glade [19:16] You can play with it as needed and just remember that you can always Undo any mistake you make or don't know how to correct :) [19:16] So remember, "quickly design" to edit your UI [19:16] You can make new dialogs inside Glade, but it's better to let Quickly make them for you, so that they are hooked up correctly in code [19:17] So let's say you want to add a cool new dialog. You can type the following: "quickly add dialog save-dialog" (for a fictional Save dialog you wanted to add) [19:17] After you do this, you should probably close Glade and re-open it with "quickly design" [19:17] Now Glade will see your new dialog and you can edit it as you like [19:18] Specifics and code examples of adding dialogs are also in the "quickly tutorial" tutorial [19:18] But I'll be brief here [19:18] From your main window, you need to import the new code module that Quickly made: "from project_name.DialogName import DialogName" [19:19] So for this project, that would actually be "from test_project.SaveDialog import SaveDialog" [19:19] Then you use normal GTK code to run it and check the result: [19:19] d = DialogName() [19:19] response = d.run() [19:19] if response == gtk.RESPONSE_OK: [19:20] #do your stuff [19:20] d.destroy() [19:20] And that's it! [19:20] Pretty simple to make a dialog [19:21] Now, if you want to respond to what the user does, you're going to need to listen to GTK signals [19:21] Real briefly, when the user does something like click a button, GTK emits a signal that you can respond to, like "clicked" [19:22] Important signals that you may care about are that buttons emit the "clicked" signal, menu items emit the "activated" signal [19:22] It's really easy to handle these signals [19:22] Let's say you want to handle a menu item press in your main window [19:22] You first note what the menu item is called in Glade [19:22] You can check this from the widget tree in the upper right [19:22] Remember that name [19:23] Now in the code, you can add a new function named like: [19:23] def on_menuitem1_activated(self, widget, data=None): [19:23] and inside that function, add the code that should happen when the menu item is pressed [19:24] Quickly already provides some code for common menu items like Quit and About, but not all of the default menu items have code already [19:24] In Ubuntu 10.10, you'll also need to go into Glade and point it at your new function [19:24] There is a "Signals" tab in the bottom right [19:24] And go there and enter the name of the function you just created next to the "clicked" signal [19:25] In Ubuntu 11.04, Quickly can do this for you, as long as you name it like above: on_WIDGET_SIGNAL [19:25] So a "clicked" signal on "button1" would be on_button1_clicked [19:25] * mterry pauses for a sec. Any questions? [19:26] hobbsc asked: Is quickly generating gtk2 or 3? [19:26] hobbsc, GTK 2 for now. I'd like to move it to 3 next cycle [19:27] But in keeping with using the recommended tools, GTK 2 is still the default toolkit for Ubuntu 11.04 [19:27] I believe Ubuntu will be ported to 3 next cycle, so Quickly should move along with it [19:27] OK. So if you want to edit the code that Quickly makes [19:28] incorrect, asked about PyGI vs PyGTK [19:28] PyGTK won't support GTK 3, so we'd have to move to PyGI at the same time. Quickly doesn't currently use PyGI [19:29] So if you want to edit the code, you can just open up the test_project folder in your project and look at all the code. Or run "quickly edit" [19:30] You'll see for example that your main TestProjectWindow class has a function "finish_initializing". This is the recommended hook for inserting your own startup code [19:30] In Ubuntu 11.04, there will be a test_project_lib folder that contains code that Quickly "owns" and it isn't recommended you touch it. But you can take or leave the code there yourself. There will be one entry point in the main TestProjectWindow class that you control [19:31] So let me talk about debugging real briefly [19:31] The usual recommended method is just adding print statements and seeing what effect that has. :) [19:31] It's quick, dirty, and easy [19:32] If you are interested in more comprehensive debugging, especially if you want to be able to ask your users for log files, you can use the logging framework [19:32] The sample code Quickly makes does that, so you can see code examples [19:32] It by default won't spit out messages unless you're running your app in verbose mode [19:32] Or if you're debugging something very complicated, you can use pdb, which is a python debugger [19:33] It's a bit difficult to use, so I just recommend using print statements [19:33] Oh, I forgot! If you want to run your app after you close it, use "quickly run" [19:33] And "quickly help" should give you a list of commands [19:34] So now we come to the exciting stuff. So far, Quickly has just been a jump-start to your app development [19:34] But it also integrates with Launchpad to help you publish, share, and maintain your software [19:35] For example, it keeps your code in bzr and you can save your changes with "quickly save" [19:35] Or if you have a Launchpad project, it can upload tarballs and make announcements [19:35] crazedpsyc asked: When might logging be better than print statements? I think printing some error messages that identify the line of code that has the problem and what the problem is is much more useful, because users usually don't bother to find and read log files [19:36] crazedpsyc, for errors that you "expect" to see in the field like a file that didn't open or an unexpected corner of your code [19:36] I would recommend logging [19:37] I think print statements are most useful just for yourself when you're hunting down some problem [19:37] So that is, your app should probably ship with just logging lines [19:37] But when I'm futzing with it, I like to add print lines to find where the problem is [19:38] So let's talk a bit about packaging [19:38] This is something that is normally difficult to do, but Quickly tries to make easy [19:39] You have different "levels" of complexity here. You can create a local Ubuntu package, you can share your package with testers, you can publish a new final version of your package, or you can even put your package in the Software Center [19:39] Let's start simple [19:39] "quickly package" will package up your current code and create a .deb file for you [19:40] But before you do that, actually, it's probably a good idea to set up some metadata [19:40] You can open the setup.py file that Quickly made for you: "gedit setup.py" [19:40] Near the bottom are some fields like author name, etc [19:40] You also probably want to edit the AUTHORS file and put your name and email there [19:41] And if you had a particular license in mind besides GPL-3, you can run "quickly license BSD" or whatever license you like [19:41] GPL-3 is the default though [19:41] You may also want to edit test-project.desktop.in and change the application properties so it shows up in the right application category in the menus [19:41] You can see a list of the correct categories here: http://standards.freedesktop.org/menu-spec/latest/apa.html [19:42] OK, now that we did all that bookkeeping, you can make your package [19:42] You could have made it before too, Quickly will just fill in bogus info for you [19:42] But it's better to have it all nice and correct :) [19:42] So now after a "quickly package" you'll have a .deb file [19:42] You can double click on this in the file manager and install it into your system for testing [19:43] And you can share that .deb via email or a web site for a small number of people [19:43] But if you want wider testing [19:43] You may want to consider creating a PPA [19:43] PPAs are a little bit more involvement for you, but it makes it so much easier to test your app that it's probably worth it for you in order to have more testers [19:44] So Launchpad has some good documentation on what you need to do here, https://help.launchpad.net/Packaging/PPA [19:44] But you'll need an SSH key and a GPG key [19:44] https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair [19:44] https://help.launchpad.net/YourAccount/ImportingYourPGPKey [19:44] Those are a couple more Launchpad help pages for how to make those [19:45] Once Launchpad knows about you and you've created the PPA, you're ready to tell Quickly [19:45] You should set DEBEMAIL and DEBFULLNAME environment variables for the benefit of "quickly package". This will note that you were the one that created the package, otherwise Launchpad won't accept it [19:45] So set them like: [19:45] export DEBEMAIL="oliver.twist@example.com" [19:46] export DEBFULLNAME="Oliver Twist" [19:46] If you put those lines in your ~/.bashrc file, they will be set up for you every time you log in [19:46] OK, now you're all set [19:47] So if you enter "quickly share --ppa testing" it will create a new in-progress package with a version like 0.1~public1 and push it to the PPA you specify on the command line [19:47] So if you have a testing PPA, which is recommended, you can easily get feedback by sharing a new package every now and then [19:48] If you want to actually make a full release, you can do "quickly release --ppa release" and Quickly will increment the number for you and push it to the the PPA you specify [19:48] Just like the share command [19:48] By default, Quickly will pick YEAR.MONTH versioning [19:48] But you can specify the version you want to the release command [19:48] Run "quickly help release" for details [19:49] And now finally, there is a new command in Ubuntu 11.04 that lets you prepare an upload for acceptance into the Ubuntu Software Center [19:49] "quickly submitubuntu" [19:50] This creates and publishes a package to a PPA just as quickly release does [19:50] So you can pass --ppa and such [19:50] The package will have files installed into /opt as required [19:50] The package will also have special metadata that is used by the Software Center (like where the screenshot lives and such) [19:50] (See https://wiki.ubuntu.com/AppReviews for how to get approved) [19:51] You can create the same kind of package without uploading it by using "quickly package --extras" [19:51] This will generate the /opt packaging and such for you to test with [19:51] There are 10 minutes remaining in the current session. [19:51] incorrect mentioned integration with Eclipse [19:52] That is something I'd like to see happen too, but we haven't focused on that yet [19:52] Also integration with Anjuta and any other IDEs out there [19:52] We'd like to make it easy for that to happen [19:52] But we figured most programmers are familiar with the command line so we haven't rushed to IDE interaction [19:53] Again, the current set of templates (ubuntu-application, ubuntu-cli, ubuntu-pygame, and ubuntu-flash-game) are just what we've done [19:53] But it's hopefully easy to make a template of your own [19:53] See "quickly quickly" [19:53] And we'd love any help! :) [19:54] I also recommend trying out the ubuntu-pygame template: "quickly create ubuntu-pygame test-game" [19:54] It's very neat [19:54] crazedpsyc asked: wouldn't that (IDE integration) be something for the IDE developers themselves to do? They could just run os.popen("quickly [...]") right? [19:54] crazedpsyc, yes, ideally. There's nothing quite stopping them from doing it. [19:55] crazedpsyc, but since we care more than the Eclipse developers probably do about it, it likely won't happen until we make it happen :) [19:55] And since we haven't actually done the work for even one IDE yet, there may be hidden gotchas in adding support [19:55] So it would be good for us to try making one ourselves, so we can make it super easy to do from the Quickly side [19:56] But we'd definitely work with any IDE developers that were intereste [19:56] d [19:56] There are 5 minutes remaining in the current session. [19:56] That's all I had. Hopefully Quickly is fun and easy to mess around with [19:56] We hang out in #quickly and #ubuntu-app-devel channels on Freenode [19:57] If there are any questions you have after this, feel free to poke me there [20:00] Oh, and if I'm not around in the channel, rickspencer3 and didrocks are experts too [20:00] And the original Quickly devs [20:00] (they are the originals I meant) === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison [20:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison [20:02] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison_ [20:02] Thanks a lot mterry for a great session, and let's clear the floor for allison_, Ubuntu's Technical Architect, who's going to tell us how to get your applications into Ubuntu [20:02] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [20:03] allison_, all yours! [20:05] (let's wait for a sec while we sort out some IRC issues) === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Getting Your App in the Distro: The Application Review Process - Instructors: allison_, wendar [20:05] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [20:06] Hi all. [20:06] mterry has given an excellent session on Quickly. This session is a "next step". [20:07] Once you have an application packaged, there are a few ways to get it into Ubuntu. [20:07] I'll be going over one of those ways, through the Application Review Board. [20:08] The basic idea is to make it very quick and easy to get lightweight applications into Ubuntu. [20:09] You can submit them today, and have them available to download in a couple of weeks, instead of waiting for the next release of Ubuntu. [20:11] The first step is to submit a ticket to the review board. [20:12] They need a few essential details for the proposal. [20:12] Some are obvious: the name of the project, your name, and how to contact you. [20:13] We also ask for you to have already set up your project in a PPA. [20:13] That can catch a lot of common errors, so it's as helpful for you as it is for the reviewers. [20:14] One thing that submitters often miss is a description of the project and what it does. [20:15] You've probably been working on your app for months, but it's brand-new to the reviewers, so it's helpful to guide them to understanding what's wonderful about the app. [20:17] It's worth taking a look at the submission guide, it has a good example of what to include in the proposal. [20:17] https://wiki.ubuntu.com/AppReviewBoard/Submissions/Request [20:18] The next step is the initial review. One of the reviewers will volunteer as "shepherd" for your proposal. [20:19] Your shepherd will read through your code and the packaging, and may offer suggestions on improvements, or help you find more details on the requirements for apps. [20:21] You and the sheperd may repeat a few rounds of changes and releasing a new version into your PPA. [20:23] In some cases the shepherd may recommend that your app is too big, too complex, or too important for the Application Review Board process and will ask you to take it to the full revue process for inclusion in Ubuntu's universe repository. [20:24] In most cases, you and the shepherd will work together and bring your app to a point where it's ready for a final review. [20:25] In the final review, the shepherd will recommend your app in one of the App Review Board meetings. [20:25] These happen every two weeks on the #ubuntu-meeting channel. [20:26] You can find the next meeting listed on https://wiki.ubuntu.com/AppReviewBoard/Agenda [20:26] or on the Ubuntu Fridge calendar. [20:27] The board will vote on your app, and accept it for inclusion, recommend changes, or (in very rare cases) reject it. [20:28] If they ask for changes, you'll just work with your shepherd to get those made, and bring the app back in the next meeting. [20:29] Once your app is accepted, there's a little bit of work needed to set up screenshots for the app. [20:30] This is a bit of a hassle right now, but soon there will be a web form to submit your screenshots. [20:31] After the screenshots are set up, the review board will launch your app in the extras repository. [20:33] Extras is turned on for everyone in Maverick and Natty, so your app will be immediately available in the Software Center, and other package management tools. [20:35] That's pretty much it. We've tried to make the process quite simple. [20:35] Are there any questions? [20:35] Or, any steps you'd like to go through in more detail? [20:37] titeuf_87 asked: the apps for purchase in the software center, are they submitted this way too? [20:38] At the moment, apps for purchase are handled manually. [20:38] They will soon have a web interface for submissions. [20:39] The same web interface that App Review Board apps will use for screenshots. [20:39] We'll try that out for a bit, and if it looks good, will start using that same web interface for all the App Review Board apps. [20:42] dpm asked: who can review an app? Only those who are Review Board members? [20:43] The proposals are all in a public queue, so anyone can review them. [20:43] It's very welcome to have people trying out the apps and commenting on the tickets while they're under review. [20:44] Only the Review Board members vote in the final review, but in our vote we'll consider all the feedback we get. [20:44] Reviewing and trying out other developer's apps is a great way to build up experience for your own apps. [20:45] Any more questions? [20:50] dpm asked: if I'm an app developer and I want to go through the App Review Process, where should I first start? What's the place where I find the documentation? [20:51] There are 10 minutes remaining in the current session. [20:53] We've got a wiki page to help walk developers through the steps. [20:54] https://wiki.ubuntu.com/AppReviewBoard/Submissions [20:54] You can always go back there for more information. [20:54] A few tips to send you on your way: [20:54] The basic idea for this process is that it's a good fit for lightweight applications. [20:55] Games, small single-purpose apps. [20:55] If you're writing a large or complext application, it's probably not right for this process. [20:56] There are 5 minutes remaining in the current session. [20:56] Libraries to be used by other applications also don't fit here. [20:56] But, for anything that doesn't fit in the App Review process, there's always the usual process. [20:57] And, the advantage of the usual process is that once you get into universe, your package will be updated and maintained by MOTU. [20:58] That's all, thanks everybody! [21:00] Great, thanks a lot wendar for this clear overview on the App Review process. There is now no excuse for getting your applications into Ubuntu! [21:01] Next up is tedg_, the person who knows all about indicators, and who'll be thrilled to tell you how to add them to your applications === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Adding Indicator Support to Your Apps - Instructors: tedg [21:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. === tedg_ is now known as tedg [21:10] Voice? [21:10] Woot! [21:10] Thanks Pendulum! [21:10] Hey everyone, sorry about the delay. [21:10] So my name is Ted Gould and I work with application indicators. [21:11] Application indicators are menus that appear in the Unity panel and represent various applications. [21:11] These, in general, shouldn't be used just because your project's logo is so cool. Users. hate. that. [21:12] But, it's more designed as a feature for long running applications, those that are more services to users, to expose that functionality. [21:12] A good example of this would be Tomboy, so you can use your notes all the time and keep it running. [21:12] Which is definitely useful. [21:13] There's a set of design guidelines for using the app indicators. [21:13] And that is here: https://wiki.ubuntu.com/CustomStatusMenuDesignGuidelines [21:13] It goes through the various features and what the layout should be. [21:14] If you've got any questions whether or not something should be an appindicator, that'd be a good place to get started. [21:14] I'm not going to dwell on that though, as this is Dev week, so let's assume that you're application *really* needs an appindicator :-) [21:15] For most applications that involves using libappindicator [21:15] It's a small library that makes it easy to create application indicators. [21:15] The LP page for it is here: https://launchpad.net/libappindicator [21:15] You can browse through the source code if you'd like. [21:16] But I think that examples are a bit more interesting. [21:16] We've put together a few: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Porting%20Guide%20for%20Applications [21:16] libappindicator uses the GObject Introspection framework so that it can be accesses from any language that support it. [21:17] That includes languages like Javascript and Python. [21:17] But there are others as well. [21:17] We also have direct Python bindings, though those will probably be dropped as soon as the GObject Introspection ones start to mature. [21:17] I expect the API to stay very much the same though. [21:18] So as we start to look at some of the examples (your language of choice) we start to see what you can do with libappindicator. [21:18] You need to provide a few things starting out. [21:19] The first is a name. The idea is that this is a unique string, usually the package name is good. Though any unique string will work. [21:19] If you want to have more than one for some reason, each of them should be unique. "my-project-left" "my-project-right" [21:19] You also need to provide an icon name, which is the name of the icon in the icon theme. [21:20] For many projects this is the main icon for the project, though it could be anything really. [21:20] You also need to provide a category. This is mostly use for sorting the indicators, so that similar things end up next to each other. [21:21] The next thing that needs to happen is you need to build a menu for that app indicator. [21:22] You can do this in GTK+ and libappindicator will take care of making sure that gets translated over the bus. [21:22] You can also attach to the normal GTK signals and those will be synthesized from the DBus signals as well. [21:23] I'm not going to go much into building menus, the examples there all have ways to do it. === tubadaz_ is now known as tubadaz [21:23] You should look at GTK resources like http://gtk.org/documentation.html to learn more about that. [21:24] This is all that is needed for a basic application indicator -- but you shouldn't stop there! [21:24] There are some other features that can really improve your application indicator. [21:24] One of those is providing an accessible name for the icon. [21:25] Users who are disabled can't tell what the icon is, so a screenreader need some information to learn about the icon. This is the accessible label. [21:25] It's important for making your application work well for everyone. [21:25] You can also put a label next to your application indicator. [21:26] For instance, indicator-weather uses this to put the current temperature on the unity panel. [21:26] In general, we recommend that you provide a way to disable the label feature as it can be disruptive to some users. [21:27] There are definitely use cases for small strings though, and this provides a way to do those. [21:27] Also, Application Indicators provide a built in attention state. [21:28] The idea here is that you could pre-configure the attention icon and then just toggle between the attention and the normal icon when the state in the application changes. [21:28] For instance if there was inclement weather or if the application lost a network connection. [21:29] From the developer's perspective this is just "another icon" but it can provide an easy to implement experience. [21:30] Since you can always query the state in the program, you don't have to keep track of which icon is being shown and you can set it all once in the initialization of the program. [21:31] There is also a few little things in the API, like being able to get mouse wheel events that can be fun. [21:31] It's good to remember that it's nearly impossible for anyone other than power users to realize the mouse wheel behavior. [21:31] But that can be a fun feature to provide those users with something extra. [21:32] That's the basics of implementing an app indicator, let me take a little break for questions before I go on. [21:32] Any questions? [21:33] Okay, seeing none, I'll assume I was perfectly clear ;-) [21:34] An advanced topic that I'd like to cover is fallbacks. [21:34] One thing that application developers told us is that they don't want to build applications that can only run on Unity. [21:34] But, they don't want working with everyone else to be a lot of work either. [21:35] So we built in fallbacks into libappindicator so that you don't have to worry about that. [21:35] What the basic fallback is using GtkStatusIcon to create a systray icon. [21:36] This icon can then be shown in environments not currently using the KSNI interface. [21:36] This would include XFCE, GNOME Shell or GNU Step. [21:37] What will happen is that the same icons will be shown in the systray as you specified to libappindicator. [21:37] When you click on the icon, the menu will be shown. [21:37] In a nutshell, it should be roughly the same as what happens on the unity panel. [21:38] Some application authors might not want that though. [21:38] They may want to take advantage of environment specific features. [21:38] Or they could just want to fallback to a different interface all together. [21:39] To account for that the AppIndicator object is subclassable with two overridable functions: fallback and unfallback. [21:39] fallback() gets called when libappindicator determines that there is no KSNI interface to connect to. [21:39] If that interface comes up in the mean time, it'll call unfallback. [21:40] This takes care of cases where the KSNI interface may crash or start up in a different order than is normally expected. [21:41] This can be pretty straightforward, if you're planning on doing this I'd look to the fallback functions that are in the libappindicator codebase for implementing GtkStatusIcon and base your's on those. [21:41] They provide all the basic functionality, and can be extended. [21:42] So does anyone have questions on fallbacks? [21:43] Seeing none, I'll continue on. [21:44] So the last thing I wanted to talk about is the future of application indicators. [21:44] But, it's not very exciting :-) [21:44] We've got plans to clean up the API some to make the introspection better. [21:44] And mostly maintenance task surrounding that. [21:45] We expect that application indicator should stay stable at least through the 12.04 release which will hopefully be an LTS. [21:46] We do expect to drop the custom Python bindings for a GObject Introspected version. [21:46] We hope to do the same with the C# bindings, but it's less clear when the GObject Introspection interface will be complete there. [21:47] So that's mostly what I had hoped to cover in today's session. [21:47] Is there anything else you guys would like me to talk about? [21:48] Okay, I'll call it a wrap then. [21:48] Thanks everyone! [21:48] dpm, Who's up next? [21:51] There are 10 minutes remaining in the current session. [21:52] ok, thanks tedg for a great talk [21:54] Next in a few minutes is Launchpad rockstar henninge, from the former Launchpad Translations team, who is going to talk about how you can make your application talk any language. Don't miss that one! [21:56] There are 5 minutes remaining in the current session. === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat || Event: Ubuntu App Developer Week - Current Session: Using Launchpad to Get Your Application Translated - Instructors: henninge [22:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html following the conclusion of the session. [22:01] Hello and welcome to this session on "Using Launchpad to get your application translated". [22:02] This session is about how Launchpad can help you to get your application translated and includes a hands-on demonstration of the setup needed to get you going. [22:02] It is not about making your application translatable. David Planella gave a presentation on that on Monday and I encourage you to read the session log if you have not already done so.[1] I will paste the URL at the end. [22:03] Feel free to interrupt and ask questions any time but we also have a lot of ground to cover. [22:03] David explained a lot about the basic concepts and software needed to get your application internationalized. I will only repeat a little of that here as a summary to make sure we are all on the same page. [22:03] I have often seen people come to Launchpad Translations wanting to translate their application saying "I don't know anything about translations or gettext." I have to tell them that, sorry, even as a maintainer they will have to be familiar with the gettext system in general and how it makes your application appear in different languages. [22:04] On the other hand, let me quote from the gettext manual: [22:04] "As a maintainer, you do not have to take on your shoulders the responsibility of checking if the translations are adequate or complete, and should avoid diving into linguistic matters. Translation teams drive themselves and are fully responsible of their linguistic choices for the Translation Project. Keep in mind that translator teams are not driven by maintainers. You can help by carefully redirecting all communications and re [22:04] ports from users about linguistic matters to the appropriate translation team, or explain users how to reach or join their team." [2] [22:05] What is true for the GNU Translation Project is also true for the translations teams working on translations in Launchpad. Your responsibilty is to provide them with the English strings they need to translate and to publish their translations with your application as often as possible. Translators don't like doing translations only to find out they never make it to the application users. [22:05] Launchpad Translations is there to help you with that responsibility. [22:05] Demo project and staging server [22:05] ------------------------------------------------ [22:06] For this session I will be using a fictional project called 'mytranslatable' on our demo server 'staging'. You will notice that all URLs contain 'staging' but apart from that they are identical to the real Launchpad. Similar for the URLs to Bazaar branches which contain an extra '//staging/' component that needs to be left out for the live code hosting server. [22:06] In order for all of you to be able to follow along, 'mytranslatable' is owned by an open team I created so anybody in that team can see the configuration pages. Go and join that team now but please don't change any settings on 'mytranslatable' because that would cause confusion. (No damage, though, because this is just the staging server.) [22:06] https://staging.launchpad.net/~mytranslatable-maintainers/+join [22:07] Alternatively you can create your own project on staging and follow along with that. In that case you need to replace 'mytranslatable' with the name of your project in all URLs. [22:07] Please be aware that the staging server is a bit slower and more like to time out. Please be patient. [22:09] I don't see anybody joining the team yet. Please be aware that a lot of the URLs I'll be posting won't be accessible unless you are in that team [22:09] or maybe everybody wants to create their own projects ... ;) [22:09] OK, let's dive in with some basic concepts you should be familiar with. [22:09] Marking strings as translatable [22:09] --------------------------------------------- [22:09] To be able to extract translatable strings for translation they must be marked in the source code. This is done by applying the 'gettext()' function which is usually aliased to _() for brevity. [22:10] Oh, I forgot [22:10] The source tree to the demo project is found here: [22:10] http://people.canonical.com/mytranslatable.tar.gz [22:11] Here is the source code of the two source files in that project: [22:11] http://paste.ubuntu.com/593926/ [22:11] http://paste.ubuntu.com/593927/ [22:11] You will notice the 'textdomain' call which sets the translation domain for your application. This is later used in the global translations database on the user's system (usually in /usr/share/locale) to identify your application's translations. It must therefore be unique and that's why it is often identical to the name of the application istself. [22:12] For other file types that may contain translatable strings in your project, other ways of marking and extraction will exist. The intltool package (which extends gettext) that David also mentioned is able to deal with a lot more types than plain gettext is. [3] [22:12] PO templates and PO files [22:12] -------------------------------------- [22:12] When gettext extracts translatable strings from the source code they are placed in a PO template file. It is called a 'template' because really PO files contain the actual translations and a 'template' looks just like such a file but without any translations filled in. [22:13] Here is an example from our two example source files. [22:13] http://paste.ubuntu.com/593932/ [22:13] *Without* Lauchpad translations, translators would take this file, fill out the empty translations (msgstr) and adapt the header information (ALL THE CAPITALS) to produce a PO file for their language. This file they'd submit back to your project for inclusion in the source tree. [22:13] *With* Launchpad Translations you need to get this file into Launchpad so that translators can translate it *in* Launchpad Translations. When it is time to create a new release for your project, you can just pull out the translations as PO files and put them in your tree. Launchpad helps you with that, too. [22:14] PO files are kept in a subdirectory called 'po' on your project. That is also where the template file will be created. [22:14] Creating the template is best done using intltool. If you have followed David's session on Monday using quickly, you can simply do 'quickly build_i18n' and it will build your template in the 'po' subdirectory. [22:15] Otherwise you will have to manually configure your project for intltool. To configure your project for intltool you need to create two files. [22:15] 1. po/POTFILES.in contains a list of the source files that translatable strings will be extracted from. [22:15] 2. po/Makevars contains some variables for the build process. intltool will look here and in other places to find the translation domain to use. If your project uses Automake or Autoconf intltool will scan those files as well but that is out of scope here. [22:16] Here are the the files for our example: [22:16] http://paste.ubuntu.com/594052/ [22:16] http://paste.ubuntu.com/594054/ [22:16] Now you need to go into the 'po' directory and run 'intltool-update -p' which tells intltool to create a new template. I get an error message in the run about a newline in a file name but it seems to work fine. You end up with a file called 'mytranslatable.pot'. [22:17] Everybody following along? This was mostly repetition, we will now move over to Launchpad. [22:18] Set up a project in Launchpad [22:18] -------------------------------------------- [22:18] Before we can push our source tree with the template we need a project that it can be associated with. A project is created here: [22:18] https://staging.launchpad.net/projects/+new [22:18] Let's assume you created a project called 'mytranslatable', then it's home page will be here: [22:18] https://staging.launchpad.net/mytranslatable/ [22:19] I actually created that project on staging, so you can go to that URL and have a look. [22:19] Once the project is created, you need to configure it for translations. Click on 'Configure translations' on the right hand side of the projects home page and it'll take you there. [22:19] https://staging.launchpad.net/mytranslatable/+configure-translations [22:19] Choose these settings: [22:19] Type of service: Launchpad [22:19] Translation focus: trunk [22:19] Translation group: Launchpad Translators (We'll talk about that in a bit) [22:19] Translation permission policy: Structured [22:20] Next we need a branch to import to. From the projects home page click 'Configure project' branch. [22:20] https://staging.launchpad.net/mytranslatable/trunk/+setbranch [22:21] Chose 'Create a new, empty branch ...' and enter the Branch name as 'trunk'. [22:22] Since I already did that, the current branch is already filled out in the top input field. [22:22] Finally we need to tell Launchpad to import the translation template from this branch. For this we go to the Translations page of the trunk series. From the project homepage go to the 'Translations' tab at the top of the page. There under 'Set up translations for a series' click on 'automatic import'. This will take you here: [22:22] https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings [22:23] This page should mention the branch we just created as 'lp://staging/mytranslatable'. Under Import settings chose 'Import template files' and save the settings. [22:24] Now the project is ready to receive the template. [22:25] Getting the PO template into Launchpad [22:25] ------------------------------------------------------- [22:25] This is done by creating a bazaar branch containing the template file. The branch we just created in Launchpad is just an empty directory so far that we need to fill. [22:25] If you used quickly it already created a branch for you. Otherwise create the branch by calling 'bzr init' in the projects root directory. [22:26] I will do that now here on my machine and paste the output. [22:26] [~/canonical/playground] [22:26] henning@hobbes:$ cd mytranslatable [22:26] [~/canonical/playground/mytranslatable] [22:26] henning@hobbes:$ bzr init [22:26] Created a standalone tree (format: 2a) [22:27] Now add the files to the branch by calling 'bzr add'. It automatically adds all files that were not in the branch yet. Make sure your template is among them. [22:28] Again, doing it locally now. [22:28] [~/canonical/playground/mytranslatable] [22:28] henning@hobbes:$ bzr add [22:28] adding po [22:28] adding src [22:28] adding po/Makevars [22:28] adding po/POTFILES.in [22:28] adding po/mytranslatble.pot [22:28] adding src/main.c [22:28] adding src/main.py [22:29] Now commit those changes to the branch. [22:29] [~/canonical/playground/mytranslatable] [22:29] henning@hobbes:$ bzr commit -m "Initial commit." [22:29] Committing to: /home/henning/canonical/playground/mytranslatable/ [22:29] added po [22:29] added src [22:29] added po/Makevars [22:29] added po/POTFILES.in [22:29] added po/mytranslatble.pot [22:29] added src/main.c [22:29] added src/main.py [22:29] Committed revision 1. [22:30] Finally push it to the branch we created on Launchpad. We need to tell bzr not to complain about the already existing directory on Launchpad. Also it is nice to remember where we pushed to so that that information can be ommitted in the future. [22:30] [~/canonical/playground/mytranslatable] [22:30] henning@hobbes:$ bzr push --remember --use-existing-dir lp://staging/mytranslatable [22:30] Host key fingerprint is 9d:38:3a:63:b1:d5:6f:c4:44:67:53:49:2e:ee:fc:89 [22:31] Created new branch. [22:31] You can look at the branch on Launchpad now and see that push is being processed. [22:32] https://code.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk [22:32] It says "Updating branch..." [22:32] This is almost it. [22:33] We'll have to wait a little for the branch to be procecssed and the template to be imported. [22:33] You can see it happening in the import queue of the project series. [22:33] https://translations.staging.launchpad.net/project-no1/trunk/+imports === tubadaz is now known as tubadaz_away [22:33] oops, wrong URL. [22:34] I was trying this out earlier today. [22:34] https://translations.staging.launchpad.net/mytranslatable/trunk/+imports [22:34] Yeah, empty queue is correct. ;-) === tubadaz_away is now known as tubadaz [22:35] The branch has been processed and you can now actually browse the code on Launchpad. [22:35] Click 'Browse the code' on the branch page. [22:35] http://bazaar.staging.launchpad.net/~mytranslatable-maintainers/mytranslatable/trunk/files [22:36] While we are waiting for the import to be processed, let's talk about the next step. [22:36] Finding translators [22:36] -------------------------- [22:36] So, who will do the translations? [22:37] You remember that during the configuration we chose 'Launchpad Translators' as the translation group for the project. A translation group assigns translation teams to languages. Together with the the 'Structure' translation permission that we specfied this means that only members of those teams are allowed to actually add and/or approve translations. This restriction is there to ensure that translations are of good quality. [22:37] sorry, that is 'Structured' [22:38] The Launchpad Tranlators group has translation teams assigned for 42 languages. You should familiarize yourself with their policies and ask them to start translating your project. You can find all information about Launchpad Translators here: [22:38] https://translations.launchpad.net/+groups/launchpad-translators [22:38] (Not a staging URL on purpose) [22:40] Of course it is possible to start your own translation group and assign translation teams yourself. [22:41] But that will make you responsible to find translators yourself and organize them. This is the hard part about translation applications. [22:41] s/translation/translating/ [22:41] Another option would be not to choose a translation group at all and leave the permissions "Open" so that anyone can translate. [22:42] The problem here is that nobody feels responsible for the translations and experience has shown that "Open" permissions lead to bad quality translations. [22:43] Ah, the template has been extracted from the branch and placed in the queue. [22:43] https://translations.staging.launchpad.net/mytranslatable/trunk/+imports [22:43] It is automatically 'Approved' as is the case with imports from branches. [22:44] Now the import script will pick it up. [22:44] Already happened! [22:45] (reload the queue page) [22:45] Once the template is imported, you can go to its overview page in Launchpad. [22:45] https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatable [22:45] uh-oh, wrong link. [22:45] But you can get there from the queue ... [22:45] https://translations.staging.launchpad.net/mytranslatable/trunk/+pots/mytranslatble [22:46] yeah, my bad typing [22:46] You will notice that no or just a few languages will be displayed. Don't worry about that. Every Launchpad user will only see those untranslated languages that they have configured as their preferred languages. So a Chinese translator will see Chinese in the listing and be able to click on it to start translating. Once the first string is translated to a language, that language will be visible for all in the template. You can cha [22:46] nge your language preferences here: [22:46] https://translations.staging.launchpad.net/people/+me/+editlanguages [22:47] So, the template is in place, we have translators translating it, what is missing? [22:47] Retrieving translations [22:47] -------------------------------- [22:47] One last step remains. How do you benefit from all the translation work done in Launchpad? [22:48] Remember the settings for branch synchronization? There is a second colmun on that page. [22:48] https://translations.staging.launchpad.net/mytranslatable/trunk/+translations-settings [22:48] Click on 'choose a target branch'. You can now select the same branch that was used to synchronize the template from. Make sure that you have *not* selected 'Import templates and translation files' in the left column of the settings page because that would create an unwanted loop. [22:49] Doing that now ... [22:50] Now the settings page says "Exporting translations to branch: lp://staging/mytranslatable" [22:50] The PO files with the translations will be exported daily (if they have changed) to your branch from where you can retrieve them with "bzr pull" or "bzr merge". [22:51] There are 10 minutes remaining in the current session. [22:51] They will be placed in the 'po' directory of your branch from where you can process them to MO files which you can distribute with your application. [22:52] I cannot demonstrate that here because the export will only happen in a few hours but we can check back tomorrow. [22:52] I'll do some translations that can be exported. [22:52] So, this is it. [22:53] Your created a template of English strings to be translated. [22:53] You created a project in Launchpad and configured it for translations. [22:53] You created a branch with the source code and the template and pushed that to Launchpad. [22:54] You asked the translators to start translating. [22:54] You are able to retrieve the translations back into your source tree for distribution. [22:54] I hope you could follow along. [22:54] There is help on https://help.launchpad.net/Translations/ [22:55] A good starting point is here: https://help.launchpad.net/Translations/YourProject/BestPractices [22:55] Which will guide you through the process, similar to what I just did. [22:55] Questions? [22:56] There are 5 minutes remaining in the current session. [22:56] Ok, here are the promised links ;) [22:56] Links [22:56] ------- [22:56] [1] David's session log: [22:56] https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/InternationalizingApps [22:56] [2] Gettext manual, The Maintainer's View [22:56] http://www.gnu.org/software/gettext/manual/gettext.html#Maintainers [22:56] [3] Intltool [22:56] https://launchpad.net/intltool [22:56] (apt-get install intltool ; man intltool) [22:57] Thank you for reading. Good night. ;-) [22:58] Thanks a lot henninge, and with this we wrap up day 4 of Ubuntu App Developer Week! See you tomorrow with lots more of great content! [23:01] Logs for this session will be available at http://irclogs.ubuntu.com/2011/04/14/%23ubuntu-classroom.html === ChanServ changed the topic of #ubuntu-classroom to: Welcome to the Ubuntu Classroom - https://wiki.ubuntu.com/Classroom || Support in #ubuntu || Upcoming Schedule: http://is.gd/8rtIi || Questions in #ubuntu-classroom-chat ||